AFNI Message Board

Dear AFNI users-

We are very pleased to announce that the new AFNI Message Board framework is up! Please join us at:

https://discuss.afni.nimh.nih.gov

Existing user accounts have been migrated, so returning users can login by requesting a password reset. New users can create accounts, as well, through a standard account creation process. Please note that these setup emails might initially go to spam folders (esp. for NIH users!), so please check those locations in the beginning.

The current Message Board discussion threads have been migrated to the new framework. The current Message Board will remain visible, but read-only, for a little while.

Sincerely, AFNI HQ

History of AFNI updates  

|
October 09, 2009 12:50PM
I think I've done something similar to create oblique masks of single-voxel spectroscopy. One very nice thing I appreciate about AFNI is how straightforwardly it deals with coordinates. I settled on this approach:

1) Create a "plumb" prototype centered on the origin. This is a 3x3x3 volume. The center voxel has value 1 and all other other voxels are 0. Set the pixel dimensions to the correct physical sizes.

2) Create an affine translation matrix (aff12.1D) that computes the coordinates inside the prototype given a coordinate in the "master" dataset (The master dataset is the space of the image you want). cat_matvec is very helpful for combining/inverting transformations. This lets you avoid intermediate interpolations.

You will need a transform that goes from the desired geometry to the prototype geometry. (You could encode the dimensions here instead of in the prototype, but I find the other approach easier). Again cat_matvec is very helpful here.

3) Use "3dAllineate -1Dmatrix_apply aff12.1D -source prototype -master masterset -final NN -prefix output" to "render" the voxel onto the spatial grid of the master.

I've used this to create mask volumes in +tlrc space with fewer interpolation artifacts on the boundary than if you interpolate a mask volume. If you also want partial volume results, the easiest thing is to temporarily create a higher resolution "master" and then use 3dfractionize to reduce the resolution.

--judd
Subject Author Posted

Need advice re data coord rotation and translation

Michael Worden October 09, 2009 09:45AM

Re: Need advice re data coord rotation and translation

Judd October 09, 2009 12:50PM

Re: Need advice re data coord rotation and translation

Michael Worden October 14, 2009 09:06AM