[pymvpa] Question about NiftiDataset
Scott
gorlins at MIT.EDU
Mon Apr 6 14:30:26 UTC 2009
yet another two cents:
ds = reduce(operator.add, [NiftiDataset(...) for something in
somethingelse])
or even
ds = reduce(operator.add, map(createNiftiFcn, listOfInputArgs))
Yaroslav Halchenko wrote:
> I just want to complement Michael's response with a little bit more
> transparent workaround:
>
> ds_ = NiftiDataset(samples=abs_filename(betafile),
> labels=label , chunks=chunk , mask=m)
> if ds is None: ds = ds_
> else: ds += ds_
>
> or even better if you loop only to read them in and all are 3D volumes:
> ds = NiftiDataset(samples=['file1.nii.gz', 'file2.nii.gz'],
> labels=labels, ...)
>
>
>
>> -- looping stuff ---
>>
>
>
>> if ds is None:
>> ds = NiftiDataset(samples=abs_filename(betafile),
>> labels=label , chunks=chunk , mask=m)
>> else:
>> ds += NiftiDataset(samples=abs_filename(betafile),
>> labels=label , chunks=chunk , mask=m)
>>
>
>
>
>> Thanks for your advice.
>>
>
>
>> V-
>>
>
>
>> _______________________________________________
>> Pkg-ExpPsy-PyMVPA mailing list
>> Pkg-ExpPsy-PyMVPA at lists.alioth.debian.org
>> http://lists.alioth.debian.org/mailman/listinfo/pkg-exppsy-pymvpa
>>
>
>
>
More information about the Pkg-ExpPsy-PyMVPA
mailing list