Rapidart error

93 views
Skip to first unread message

Bill Ulrich

unread,
Nov 6, 2014, 9:40:22 AM11/6/14
to nipy...@googlegroups.com
Hello all,

I was looking to incorporate the rapidart ArtifactDetect interface into my pipelines, but I'm getting stuck on what appears to be an incompatibility between Nipype and Nibabel. When I run the pipeline I get the following error:

<snip />
  File "/usr/lib/python2.7/dist-packages/nipype/algorithms/rapidart.py", line 364, in _detect_outliers_core
    (x, y, z, timepoints) = nim.get_shape()
ValueError: need more than 3 values to unpack
Interface ArtifactDetect failed to run.

Some poking around later and it seems that the 'shape' property of the object returned from the load() function only has three elements(x,y,z) but the ArtifactDetect is expecting four (x,y,z,timepoints). FWIW I'm using the latest Nipype [0.10.0] and Nibabel [1.3.0]. Has anyone else encountered this or am I (hopefully) missing something obvious?

Thanks In Advance,

Bill


Satrajit Ghosh

unread,
Nov 6, 2014, 9:52:32 AM11/6/14
to nipy-user
hi bill,

is your data 4d?

cheers,

satra

--

---
You received this message because you are subscribed to the Google Groups "NiPy Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nipy-user+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Bill Ulrich

unread,
Nov 6, 2014, 11:45:11 AM11/6/14
to nipy...@googlegroups.com
Hi Satra,

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

Satrajit Ghosh

unread,
Nov 9, 2014, 9:07:32 AM11/9/14
to nipy-user
hi bill,

let's continue the discussion here:

Bill Ulrich

unread,
Nov 10, 2014, 8:51:50 AM11/10/14
to nipy...@googlegroups.com
Ha - I noticed that the forums were moving moments after hitting 'Post'.

Thanks,

Bill


Reply all
Reply to author
Forward
0 new messages