Snippets by category: Searching

Packages Of Snippets

Snippet ID Title
Functions to convert a saved affine matrix from FSL flirt (-omat blah.txt) to a mm-coordinates matrix, relating to the NIfTI voxel-world mappings of the source and target image. Conversion in the reverse direction (from world matrix for use with flirt -init blah.txt) is also possible. The code attempts to handle both radiological and neurological examples -- please let me know if you find a case that breaks it! (I haven't tested this with Analyze images; I think it should work, but would urge everyone to use NIfTI in preference anyway)


Snippet ID Title
Ged Ridgwayconvert saved flirt matrix to NIfTI world coords matrix

[worldmat spmvoxmat fslvoxmat] = flirtmat2worldmat(flirtmat, src, trg);
Ged Ridgwayconvert NIfTI world (mm) coordinates matrix to flirt

[flirtmat spmvoxmat fslvoxmat] = worldmat2flirtdmat(worldmat, src, trg);