Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

WIP: parrec2nii sets qform code to 2#478

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation

@JasperVanDenBosch
Copy link
Contributor

fixes#463

@JasperVanDenBosch
Copy link
ContributorAuthor

We've added two tests; the first, a unit test, that requires themock library. (which is why it's currently failing). If this is not desirable, I'll take it out. If it is, where should I add themock dependency, inrequirements.txt ortravis.yml?
The second test does a save->load type acceptance test.

@matthew-brett
Copy link
Member

Thanks for doing this. Would you mind posting to the mailing list to ask for opinions about relying on the 'mock' library?

@matthew-brett
Copy link
Member

Thanks. Would you mind adding mock to thedev-requirements.txt file as well. Could yougrep fornose in the docs section, to update the installation / testing instructions?

@matthew-brett
Copy link
Member

I added a check for "mock" when running tests vianibabel.test() :JasperVanDenBosch#1

@matthew-brett
Copy link
Member

Use the machinery intest_scripts.py to find the executable?

@JasperVanDenBosch
Copy link
ContributorAuthor

I completely overlooked that.. but the downside of that scriptrunner is that we still wouldn't be able to test the separate functions / import the code.

Long term I think ideally we'd refactor most of the logic out of theparrec2nii executable and into a regular module, which is more straightforward to test. For now I added a list of possible binary directories to look for parrec2nii.

@coveralls
Copy link

coveralls commentedAug 11, 2016
edited
Loading

Coverage Status

Coverage increased (+0.008%) to 96.251% when pullinge23dafc on ilogue:qform-provided-then-qform-code-2 intoe37cb5d on nipy:master.

@coveralls
Copy link

coveralls commentedAug 11, 2016
edited
Loading

Coverage Status

Coverage increased (+0.008%) to 96.251% when pullinge23dafc on ilogue:qform-provided-then-qform-code-2 intoe37cb5d on nipy:master.

@codecov-io
Copy link

codecov-io commentedAug 11, 2016
edited
Loading

Current coverage is 93.81% (diff: 51.26%)

Merging#478 intomaster will decrease coverage by0.46%

@@             master       #478   diff @@==========================================  Files           161        163     +2     Lines         21321      21555   +234     Methods           0          0            Messages          0          0            Branches       2284       2315    +31   ==========================================+ Hits          20100      20221   +121- Misses          801        902   +101- Partials        420        432    +12

Powered byCodecov. Last updatee37cb5d...aa184ed

@matthew-brett
Copy link
Member

How aboutJasperVanDenBosch#2 ?

matthew-brettand others added2 commitsAugust 10, 2016 19:18
Move the parrec2nii code into its own module for easier testing.
RF: move parrec2nii code into own module
@JasperVanDenBosch
Copy link
ContributorAuthor

Looks good, thanks! I'll check back if there's any failing tests.

@coveralls
Copy link

coveralls commentedAug 11, 2016
edited
Loading

Coverage Status

Coverage decreased (-0.4%) to 95.815% when pullingaa184ed on ilogue:qform-provided-then-qform-code-2 intoe37cb5d on nipy:master.

@matthew-brett
Copy link
Member

Thanks. I think coverage is down quite a bit, but I believe that's because the parrec2nii command code wasn't covered well, and we are now seeing that in the coverage report, so no not the fault of this PR.

Current PR is fine with me.

Any other suggestions?

@JasperVanDenBosch
Copy link
ContributorAuthor

No further suggestions! Thanks

On Aug 11, 2016 2:49 PM, "Matthew Brett"notifications@github.com wrote:

Thanks. I think coverage is down quite a bit, but I believe that's because
the parrec2nii command code wasn't covered well, and we are now seeing that
in the coverage report, so no not the fault of this PR.

Current PR is fine with me.

Any other suggestions?


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#478 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/ABcEjIWg2Nzz6Z3woX-H0cyLDQ2nSyfgks5qe5kDgaJpZM4JglbJ
.

@matthew-brett
Copy link
Member

Actually, sorry, now I think if it - shouldn't thesform andqform codes both be 1 here? In that they indicate the scanner coordinates?@grlee77 - what do you think? Will this cause problems for you?

@mrjeffs
Copy link

hi matthew, because we are dealing with un-transformed data (pre-alignment with standard brains etc), both the q and sforms (and codes) should be the same whichever is decided. as i understand it, sform is diverged from qform when transformed into standard space and qform is kept to reference path to original subj space. see
https://github.com/stnava/ANTs/wiki/How-does-ANTs-handle-qform-and-sform-in-NIFTI-1-images%3F
Currently only sform is saved and sform code=2 in parrec2nii. see header dumps in my orig issues posthttps://github.com/nipy/nibabel/issues/463
you are right both codes should =1 if --origin='scanner' is default and no other transformation applied.
since arbitrarily sform code=2 when nibabel saves parrec images, does it change code from 1 to 2 when the parrec are transformed from Philips PLS to RAS+? technically that is a transformation by applying an affine but not an 'alignment'. this may be the default behavior since this exception has not been accounted for.
rather than ferret out this exception or have 2 different codes for the same space, i vote to manually set both sform and qform_code=1 e.g. 'Scanner Anat'. as in lines 220-226 in parrec2nii with my last 2 lines added:
# Make corresponding NIfTI image nimg = nifti1.Nifti1Image(in_data, affine, pr_hdr) nhdr = nimg.header nhdr.set_data_dtype(out_dtype) nhdr.set_slope_inter(slope, intercept) nhdr['qform_code'] = 1 nhdr['sform_code'] = 1
then both are saved identically and both =1.

@matthew-brett
Copy link
Member

qform / sform code of 1 is fine with me, but it is a small API break. If there is some software that behaves differently with sform codes of 1 and 2 then something would change, but I doubt that would happen. OK to take the risk?

@grlee77
Copy link
Contributor

I am fine with setting both to 1. (The previous behavior was sform=2, qform=0?)

@matthew-brett
Copy link
Member

Right

@matthew-brett
Copy link
Member

OK - I'll merge this as-is, then do a PR for the code changes.

@matthew-brettmatthew-brett merged commit42959a3 intonipy:masterAug 15, 2016
matthew-brett added a commit to matthew-brett/nibabel that referenced this pull requestAug 15, 2016
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

qform not saved

6 participants

@JasperVanDenBosch@matthew-brett@coveralls@codecov-io@mrjeffs@grlee77

[8]ページ先頭

©2009-2025 Movatter.jp