Print

Print


Hi Amir,

if your registration algorithm has a Matlab interface, you should have a 
look at SPMs volume/data sampling routines, namely:
spm_vol
spm_sample_vol for sinc/polynomial interp
spm_bsplinc/spm_bsplins for bspline interp
This will help you resample your image to any grid you want and 
incorporate NIfTI orientation information as well.

Volkmar


On Mon, 12 Feb 2007, Amir M. Tahmasebi wrote:

> Hi Ged,
>
> Thanks for your reply and sorry for the confusion. I will describe what 
> exactly I want to do:
>
> I want to use all preprocessing steps from SPM up to normalization. Instead 
> of normalization of SPM, I would like to use another registration algorithm 
> and use the results for SPM-based fMRI analysis. My registration algorithm 
> requires the input image (source) and the template to have 256x256 size in XY 
> plane with the same resolution. I am a bit confused at the coregistration 
> step:
>
> My structural data is 224x256x176 (1x1x1mm). My template is 256x256x185 
> (1x1x1) and the fMRI EPI data is 64x64x26 (3.3x3.3x5.0).
>
> At the coregistration step, I will register structural to mean fMRI but I am 
> not sure what option I should select at this step: coreg only, or reslice and 
> coreg? First, I want to put my EPI and structural in the same space (coreg) 
> and then use my non-rigid algorithm to register the structural to the 
> template and use the output deformation fields to bring my fMRI data to 
> template space as well. So the fMRI and structural should be both resampled 
> to have 256x256 dim in XY plane and the same resolution as the template 
> (1x1x1).
>
> When I choose coreg only (at coregistration step) and then resample the data 
> using reorient (John's code), the output will be 178x233163. I assumed if we 
> do NOT choose reslice, all the transformation info will be saved in the .mat 
> file. However, I realized after resampling the data  the center and the size 
> of the structural is not the same as fMRI mean. Since the centers and the 
> sizes are not the same, I believe I won't be able to apply the same 
> deformation field (from registration of structural to template) to EPI 
> images.
>
> Second time, I choose coreg and reslice. This time after resampling the data 
> (using reorient), the size and the center of the structural is the same as 
> EPI mean. So I use Ged's code for resizing and changing the resolution and 
> then apply my registration and use the same procedure for applying the 
> deformation field to EPI. The only problem is that I lose info by reducing 
> the size and resolution of the structural. So one way would be to register 
> fMRI mean to strucutural. There are two problems: First I am not sure if it 
> would be correct to resample fMRI data to larger size and finer resolution. 
> Second, I have to reslice individual EPI images after coreging them with the 
> structural which will take ages.
>
> I really appreciate any help, Thanks.
>
> Regards,
> Amir
>
>
>
> Ged Ridgway wrote:
>>  Hi Amir,
>> 
>> >  I noticed that when I pad the image using this code or if I change the 
>> >  resolution, the image origin will be changed. In changing resolution 
>> >  case, the actual image size in mm changes as well.
>>
>>  Perhaps I'm confused, but I think these things must happen, in order for
>>  the image to remain correctly positioned in world-space.
>> 
>> >  For instance, if the input image size is 179x233x163 and the origin is 
>> >  at 92.0,95.0,61.0 (spacing 1x1x1), by applying the padding of [-77/2 
>> >  -23/2 0;77/2 23/2 0]+world_bb(), the size is changed to 256x256x164 and 
>> >  the center is changed to 131.0,107.0,61.0.
>>
>>  This "origin" is the voxel location of the world-space origin (0,0,0),
>>  since the number of voxels change (this is the padding you want, right?)
>>  the voxel indices for this location must change in order for the world
>>  origin to be in the same (world/anatomical) position.
>>
>>  If you view the original Image, and the resized rImage, in SPM's check
>>  reg, you should find they are anatomically registered -- I don't think
>>  this can be achieved with what you want here:
>> 
>> >  Is there anyway to keep the origin and size the same as its original 
>> >  version? Thanks a lot.
>>
>>  Perhaps you could clarify exactly the behaviour you are looking for?
>>
>>  Best,
>>  Ged.
>> 
>> 
>
>

-- 
Volkmar Glauche
-
Department of Neurology		[log in to unmask]
Universitaetsklinikum Freiburg	Phone	49(0)761-270-5331
Breisacher Str. 64		Fax	49(0)761-270-5416
79106 Freiburg			http://fbi.uniklinik-freiburg.de/