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

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


I have a question on the following commit:

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" %
            postscript += "SPM.xM.I = 0;\n"
            postscript += "SPM.xM.T = [];\n"
            postscript += "SPM.xM.TH = ones(size(SPM.xM.TH))*(%s);\n" %
            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?

Dimitri Papadopoulos
I2BM, NeuroSpin
F-91191 Gif-sur-Yvette cedex, France

More information about the Neuroimaging mailing list