[Neuroimaging] Distance nipype

Ariel Rokem arokem at uw.edu
Fri Jan 28 09:54:55 EST 2022


Hi Lorenzo,

Thanks for your email. Could you try the following?

my_dist =
Distance(self='/home/pnc/Desktop/PinNC_v5/test/T1w_control_005_2_brainFS.nii.gz',
         volume1 = 'mydir/test/Image1.nii.gz',
         volume2 = 'mydir/test/Image2.nii.gz',
         method =  "eucl_max")
res = my_dist.run()

To explain: in the code you sent, the error arises because you are calling
the `run` method on the class, and not an instance of the class. In the
code I provided above, I first create an instance of the class `Distance`
and then call the method from this instance.

Hope that helps,
Ariel


On Fri, Jan 28, 2022 at 6:40 AM Lorenzo Pini <pini.lorenzo2 at gmail.com>
wrote:

> Hi all,
>
> I'm using Distance to compute some metrics between two images.
> I saw the documentation and the scripts and I tried to run with the
> following command:
>
> Distance(self='/home/pnc/Desktop/PinNC_v5/test/T1w_control_005_2_brainFS.nii.gz',
>          volume1 = 'mydir/test/Image1.nii.gz',
>          volume2 = 'mydir/test/Image2.nii.gz',
>          method =  "eucl_max")
> res = Distance.run()
>
> However, there is an error with the self function:
> TypeError: run() missing 1 required positional argument: 'self'
>
> and when I inspect the input I have the following:
>
> mask_volume = <undefined>
> method = eucl_min
> volume1 = <undefined>
> volume2 = <undefined>
>
> What's the problem here?
> Thanks
> L
> _______________________________________________
> Neuroimaging mailing list
> Neuroimaging at python.org
> https://mail.python.org/mailman/listinfo/neuroimaging
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.python.org/pipermail/neuroimaging/attachments/20220128/2810df26/attachment.html>


More information about the Neuroimaging mailing list