[MINC-users] am i using mincresample correctly

Soren Christensen sorench at gmail.com
Tue Aug 7 00:03:11 EDT 2012


I don't understand how you can not see differences in register if your
images are synced? Even if the images are identical on a voxel level,
they will differ by their cosines as mentioned by Andrew. So in
register you should indeed see a discrepancy in the composite view. I
tried it here with your arguments an I see the difference in the
composite image. You will not see the differences in the input columns
(column 1 and 2). I did a mincdiff on the source and target and as
Andrew said, the cosines differ, but the voxel content was identical -
but the difference is still there in register as it should be.

On the other issue, to achieve what you want (which sounds like a
sampling grid of the same dimensions and spacing as your input grid,
but centered on the grid of the target),  you would need to calculate
start and step sizes for your resampling grid based on the center and
orientation of the target grid (from where you would calculate start
and set step positions as desired) - you could then use this volume as
the "like" option.

If the input volumes intersect spatially, that is, they have roughly
the same center, then you can get away with a -like [inputvolume] in
your mincresample (replacing your -tfm_input_sampling). Depending on
the transform though, the image object may be shifted out of the FOV
of the source image and you will just get an empty or partial image.
Check your xfm file to see how much translation is going on.
So this would be  mincresample -like source -transformtation
source2target.xfm source
source_like_sourcegrid_but_transformed_to_match_target.mnc

To achieve the above (lacking the overlap), you can center the image
volumes relative to one another, by modifying the start coordinates of
one of the volumes so that the image volumes coincide centrally (this
of course will have implication for any dependencies on the spatial
details of this file, but often it can easily be done at the top of
your pipeline as a starting point).

There may be other ways too :)

Soren




On Tue, Aug 7, 2012 at 1:00 PM, Jackie Leung
<jackie.leung at alumni.utoronto.ca> wrote:
> Thank you for the responses.  I am now fairly convinced that the transform
> did take effect, but as Andrew said, I just don't see it using register.
>
> Now this has led me to a second problem.  I wish to convert the registered
> data into nifti format using mnc2nii, but this method doesn't seem to keep
> my world coordinates, thus defeating the whole registration process.
>
> I did try the -like option in mincresample, and that does work in
> transforming the voxel space as well.  However, it also crops a significant
> portion of my data as my target image has a lot fewer slices.
>
> So, is there a way to apply a transform to the voxel space (not just world
> space) while keeping the original field of view?  or another option would
> be if mnc2nii can apply the world coordinates to the nifti output instead
> of voxel space.
>
> Any advice will be very much appreciated!!
>
> Jackie
>
> On Sun, Aug 5, 2012 at 8:57 AM, Andrew Janke <a.janke at gmail.com> wrote:
>
>> Hi Jackie,
>>
>> On 5 August 2012 10:44, Jackie Leung <jackie.leung at alumni.utoronto.ca>
>> wrote:
>> > I'm new to MINC and I'm not sure if my coregistration process is correct.
>> >
>> > After getting the transform file from 'register', I apply it to my
>> volumes
>> > (it's a 4D dataset) with the following command:
>> > mincresample -transformation matrix.xfm -tfm_input_sampling data.mnc
>> > data_reg.mnc
>> >
>> > when i view the output data using register, it looks the same as before.
>> > I'm I running the tool correctly?  Or does it have something to do with
>> the
>> > world coordinates vs voxel coordinates thing?
>>
>> My guess is that you have actually done the right thing. Just remember
>> that register displays volumes in "voxel space" and
>> -tfm_input_sampling will in general just change the voxel to world
>> transform in a file. If you want to resample a file like another (the
>> target) you probably want this:
>>
>>    mincresample -transformation matrix.xfm -like target.mnc data.mnc
>> data_reg.mnc
>>
>> An explanation of what is going on is here:
>>
>>    http://en.wikibooks.org/wiki/MINC/Tools/mni_autoreg
>>
>> This is for minctracc, but the resampling section still applies.
>>
>>
>> a
>> _______________________________________________
>> MINC-users at bic.mni.mcgill.ca
>> http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users
>>
> _______________________________________________
> MINC-users at bic.mni.mcgill.ca
> http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users


More information about the MINC-users mailing list