[Neuroimaging] [nipype] updated external mask handling in SPM

Dimitri Papadopoulos Orfanos dimitri.papadopoulos at cea.fr
Wed Dec 2 09:45:27 EST 2015


Hi,

I have a question on the following commit:
https://github.com/nipy/nipype/commit/fe9d0e07a288afefb34e99f488ef194a443d6089

Could someone explain the rationale behind the addition of this piece of
code in nipype/interfaces/spm/model.py? We came across this code while
trying to reproduce the results obtained with an old version of SPM8 run
manually vs. the latest version of SPM8 run from Nipype.

        if isdefined(self.inputs.mask_image):
            # SPM doesn't handle explicit masking properly, especially
            # when you want to use the entire mask image
            postscript = "load SPM;\n"
            postscript += "SPM.xM.VM = spm_vol('%s');\n" %
list_to_filename(self.inputs.mask_image)
            postscript += "SPM.xM.I = 0;\n"
            postscript += "SPM.xM.T = [];\n"
            postscript += "SPM.xM.TH = ones(size(SPM.xM.TH))*(%s);\n" %
self.inputs.mask_threshold
            postscript += "SPM.xM.xs = struct('Masking', 'explicit
masking only');\n"
            postscript += "save SPM SPM;\n"

We have understood almost all causes for differences in results. The
only cause that remains to be explained is this Nipype hack. Has perhaps
this issue been discussed on the SPM mailing list?

Best,
-- 
Dimitri Papadopoulos
CEA/Saclay
I2BM, NeuroSpin
F-91191 Gif-sur-Yvette cedex, France


More information about the Neuroimaging mailing list