Skip to content

artifact detect failing with list of 3d images. #993

@satra

Description

@satra

from bill @ nipy-user
The realigned_files is a list of 3D, not a single 4D. Looking at the source, it seemed like it was OK with either:

# read in functional image
if isinstance(imgfile, str):
    nim = load(imgfile)
elif isinstance(imgfile, list):
    if len(imgfile) == 1:
        nim = load(imgfile[0])
    else:
        images = [load(f) for f in imgfile]
        nim = funcs.concat_images(images)

# compute global intensity signal
(x, y, z, timepoints) = nim.get_shape()

When I jury-rigged it for testing (e.g. manually setting 'timepoints') it would fail a little further down with the same dimension mismatch at:

data = nim.get_data()
...
vol = data[:, :, :, t0]

I suspected that this may be a Nipype/Nibabel mismatch since it also complained that the get_shape() function was deprecated, but I'm somewhat new to this so I try not to assume. Anyway, thanks for taking a look. If anyone has a fix or a workaround (or sees an error in my setup) that would be great.

Thanks a ton. For completeness, I put the Original Inputs of the rapidart node at the bottom.

Cheers,

Bill

==================
* bound_by_brainmask : False
* global_threshold : 8.0
* ignore_exception : False
* intersect_mask : <undefined>
* mask_file : <undefined>
* mask_threshold : <undefined>
* mask_type : spm_global
* norm_threshold : 1.0
* parameter_source : SPM
* plot_type : png
* realigned_files : ['.../_session_id_02_subject_id_<SUBJID>/normalize/watime001.nii', ....]  {#120 files in sequence}
* realignment_parameters : ['..../_session_id_02_subject_id_<SUBJID>/realign/rp_time001.txt']
* rotation_threshold : <undefined>
* save_plot : True
* translation_threshold : <undefined>
* use_differences : [True, False]
* use_norm : True
* zintensity_threshold : 3.0

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