eXTReMe Tracker
Apr 142011
 

Assuming the nifti toolbox is in Matlab path, we can get the 91x109x91 mask to have the same dimensions as the normalized images generated with bounding boxes.

If we are making a mask for hippocampus, first we save that mask from WFU Pickatlas. Then to make it 79x95x68 voxels, run the following small script.

x=load_untouch_nii(‘hipp.img’);
x=x.img;xdim=[1:6 86:91]; ydim=[1:6 102:109]; zdim=[1:11 80:91];
origin=[40 57 26]; datatype=16;
x(xdim,:,:)=[]; x(:,ydim,:)=[]; x(:,:,zdim)=[];
nii=make_nii(x, [2 2 2], origin, datatype);
save_nii(nii, ‘boxedhippo.nii’)

We can then use these masks for signal extraction or any further processing.

  5 Responses to “Bounding box for wfu-pickatlas masks”

  1. Hi Rishi:

    How do you determine the xdim ydim and zdim? Why you use [1:6 102:109] but not ydim=[1:7 103:109]?
    The dimention of my data is 41X48X35 and vox size is 4X4X4, origin:[46,64,37];

    Thanks.

  2. @joyce
    Hi Joyce,

    What I did was I created a binary mask of the template brain, and then overlaid the binary mask obtained by applying my transformation. Then I overlaid them with some transparency to see if they were matching up or not. I kept playing with the numbers until they had a match. I tried it the empirical way rather than develop a sequencial logic for it 🙂

  3. Hi Rishi,

    I was wondering, could you also make a mask of the anterior hippocampus this way? How would you go about determining those dimensions? Thank you very much for any advice,

    Valerie

  4. Oh, this is exaclty what I need. Except that I have another size of the image. But how do I find where the origin of my image is?

    All the best!

  5. Hi Karin,
    In order to find where the origin is, you can use the ‘Display’ button in SPM to visualize your image. The image window that pops up has the ‘origin’ information displayed in there.

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

(required)

(required)