Skip to content

'write_which' of interfaces.spm.preprocess.RealignInputSpec gives matlab issues #531

@beOn

Description

@beOn

'write_which' is currently defined as follows:

write_which = traits.Tuple(traits.Int, traits.Int, field='roptions.which',
                              desc='determines which images to reslice')

This generates the following in pyscript_realign.m:

jobs{1}.spatial{1}.realign{1}.estwrite.roptions.which = (0, 1);

That is not valid matlab syntax - it causes the following type of error:

Error: Expression or statement is incorrect--possibly unbalanced (, {, or [.

I launched matlab and built a job by hand. 'which' is supposed to be a two item vecor, like so:

>> matlabbatch{1}.spm.spatial.realign.estwrite.roptions
ans =
    which: [0 1]
    interp: 4
    wrap: [0 0 0]
    mask: 1
    prefix: 'r'

If I redefine write_which like so:

write_which = traits.List(traits.Int, traits.Int, field='roptions.which',
                              desc='determines which images to reslice')

... it generates the following matlab script:

jobs{1}.spatial{1}.realign{1}.estwrite.roptions.which(1) = 0;
jobs{1}.spatial{1}.realign{1}.estwrite.roptions.which(2) = 1;

... which works.

I will submit a pull request for this shortly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions