Have a look at spm_matrix.m: given a parametrisation of an affine transformation, it will return the corresponding 4x4 transformation matrix. This is the function called if you enter “Reorientation Parameters” instead of “Reorientation Matrix”.
So I am using spm12 standalone and MCR, is it possible to call spm_matrix.m in nipype with this setup, it looks like there is no way to do that from my research online so far. Can you help me with a small script on how to do that.
The spm functions do well with full version of matlab and nipype setup , but I can find a way to implement the spm functions with MCR and nipype setup.
So I currently am implementing VBM (basic steps: reorientation, segmentation, normalization, smoothing) on some structural t1w niftis and I am using nipype , MCR and spm12 standalone to achieve this. So my spm12 standalone uses Matlab common runtime in nipype.
from nipype.interfaces import spm
matlab_cmd=’/opt/spm12/run_spm12.sh /opt/mcr/v95 script’, use_mcr=True)
and I am able to run my vbm pipeline fully just fine.
I currently pass reorientaion parameters like (x,y,z,pitch roll,yaw) in a .mat file as that is the only option which is given by the function nipype.interfaces.spm.utils.applytransform()
The goal is: I want to be able to pass reorientation parameters as arguments without needing a .mat file as input. The applytransform() does not allow that, so I am trying to implement the spm_imatrix() function as you said, but its implementation under MCR is not doable as of my knowledge. I know that custom spm functions under a regular matlab work fine, the problem is using MCR .
So if you can help , please let me know how to implement spm_imatrix() with MCR.
Say I want to implement spm_matrix.m function from spm12 standalone (using MCR) as a function node using nipype. Could you give me a sample script of that since I am not sure how to implement that. Should I expect the foll. script to work:
import nipype.pipeline.engine as pe
from nipype.interfaces.utility import Function