Skip to content

FIX: Order of SPM.NewSegment channel_info boolean tuple is (Field, Corrected) #2817

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 14, 2018
Merged

Conversation

servoz
Copy link
Collaborator

@servoz servoz commented Dec 11, 2018

Summary

  • In SPM12, for Segment module (the NewSegment in Nipype), the spm.spatial.preproc.channel.write parameter (SPM's Save Bias Corrected parameter) takes [Save Bias Field = 0 or 1, Save Bias Corrected = 0 or 1]. In nypipe the initialisation of the outputs bias_field_images and bias_corrected_images are done with the inverse order.

List of changes proposed in this PR (pull-request)

  • This commit fix this inconsistency.

Acknowledgment

  • (Mandatory) I acknowledge that this contribution will be available under the Apache 2 license.

In SPM, the spm.spatial.preproc.channel.write parameter (SPM's Save Bias Corrected parameter) takes [Save Bias Field = 0 or 1, Save Bias Corrected = 0 or 1]. In nypipe the initialisation of the outputs bias_field_images and bias_corrected_images are done with the inverse order. This commit fix this inconsistency.
@codecov-io
Copy link

Codecov Report

Merging #2817 into master will increase coverage by 0.05%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2817      +/-   ##
==========================================
+ Coverage   67.48%   67.53%   +0.05%     
==========================================
  Files         341      341              
  Lines       43343    43462     +119     
  Branches     5375     5401      +26     
==========================================
+ Hits        29248    29352     +104     
- Misses      13396    13408      +12     
- Partials      699      702       +3
Flag Coverage Δ
#smoketests 50.55% <0%> (ø) ⬆️
#unittests 64.95% <0%> (+0.04%) ⬆️
Impacted Files Coverage Δ
nipype/interfaces/spm/preprocess.py 57.03% <0%> (ø) ⬆️
nipype/testing/utils.py 91.37% <0%> (+1.72%) ⬆️
nipype/interfaces/fsl/epi.py 69.14% <0%> (+4.94%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 35b58cd...d5137c3. Read the comment docs.

@effigies
Copy link
Member

If I'm understanding you correctly, users were submitting valid (bool, bool) pairs that were being correctly interpreted by SPM, but Nipype was misinterpreting them, and specifying the wrong output?

It looks like this was written for SPM8 and adapted to support SPM12. Is it possible that the order switched in SPM12? If so, the correct response might be to reverse that tuple if SPM12 is detected, and make a note of it in the docstring.

@servoz
Copy link
Collaborator Author

servoz commented Dec 13, 2018

@effigies ,
i just checked:
In SPM8:
New Segment module:
spm.tools.preproc8.channel.write = [0 1] # Save Bias Corrected (only)
spm.tools.preproc8.channel.write = [1 0] # Save Bias Field (only)

As fas as I can check, in SPM8 the first element of the write list is concerning to the Bias Field (BiasField_aName.nii) and the second the Bias Corrected image (maName.nii) ... It is exactly the same in SPM12 (my first post). You invert in nipype! We currently overload the corresponding nipype class in our project. It will be cleaner if you fix it by merging my PR !

@effigies effigies changed the title Wrong last tuple in the channel_info parameter FIX: Order of SPM.NewSegment channel_info boolean tuple is (Field, Corrected) Dec 13, 2018
@effigies
Copy link
Member

Okay, this seems like a good fix to me.

@chrisfilo, looks like you originally wrote this interface, so I want to give you veto, in case you remember some reason this was the way it was.

@chrisgorgo
Copy link
Member

I don't see anything wrong here, but I have not used SPM in ages.

@effigies effigies merged commit 32d3dfa into nipy:master Dec 14, 2018
@effigies effigies added this to the 1.1.7 milestone Dec 14, 2018
yarikoptic added a commit to yarikoptic/nipype that referenced this pull request Jan 11, 2019
1.1.7 (December 17, 2018)

* FIX: Copy node list before generating a flat graph (nipy#2828)
* FIX: Update pytest req'd version to 3.6 (nipy#2827)
* FIX: Set ResourceMonitor.fname to an absolute path (nipy#2824)
* FIX: Order of SPM.NewSegment channel_info boolean tuple is (Field, Corrected) (nipy#2817)
* FIX: Indices were swapped for memory and cpu profile data (nipy#2816)
* FIX: ``status_callback`` not called with ``stop_on_first_crash`` (nipy#2810)
* FIX: Change undefined ScriptError on LFS plugin to IOError (nipy#2803)
* ENH: Add NaN failure mode to CompCor interfaces (nipy#2819)
* ENH: Enable cnr_maps and residuals outputs for FSL eddy (nipy#2750)
* ENH: Improve ``str2bool`` + doctests (nipy#2807)
* TST: Improve py.test configuration of doctests (nipy#2802)
* DOC: Update DOI badge to point to all versions (nipy#2804)
* MAINT: Offload interfaces with help formatting (nipy#2797)
* MAINT: Reduce minimal code redundancy in filemanip.get_dependencies (nipy#2782)
* MAINT: Delayed imports to reduce import time (nipy#2809)
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants