Export the inverse transformation matrix using FLIRT in NiPype


I wanna do a registration between ADC data and a FLAIR. When I do the register ADC to FLAIR it’s no problem. Although, I wanna register the FLAIR data to the ADC data but when doing so the registration gets terribly wrong since the FLAIR data is high res and ADC data low res.

To the question: Is it a simple way of register the FLAIR data to the ADC data?

Just wanna put out that I know that I can invert the transformation matrix recieved from registration ADC–>FLAIR and just apply it to the FLAIR data set. But I’m looking for an alternative way from that. I just want it Clean ni the NiPype worklfow.

Here´s the code section that does the registration:

Input node

inputnode_adcreg = Node(IdentityInterface(fields=[‘FLAIR’, ‘adcmap’]),

Output node

outputnode_adcreg = Node(IdentityInterface(fields=[‘adc_in_FLAIR’, ‘trans_matrix’]),

FLIRT node

FLIRT_adcreg = Node(FLIRT(), name=“FLIRT”)
FLIRT_adcreg.inputs.dof = 6

Connect workflow

wf_adcreg = Workflow(name=‘ADC_reg’, base_dir="/home/brain/Documents/iNPH_workflow/")
wf_adcreg.connect([(inputnode_adcreg, FLIRT_adcreg,[(‘FLAIR’,‘in_file’),
(‘adcmap’, ‘reference’)]),
(FLIRT_adcreg, outputnode_adcreg,[(‘out_file’,‘adc_in_FLAIR’),
(‘out_matrix_file’, ‘trans_matrix’) ])