3D input parameters using imregister

Hi,
I would like to use imregister for registration of a volume. My data is MR images, so my volume is formed by 28 slices (my matrix is 512x512x28 int16). So my question is how should I pass this matrix as input using imregister? in both examples the input images are given as a simple 2D images, so I don't know how to use it for 3D, can someone help me?
Thank you in advance.

 採用された回答

Sean de Wolski
Sean de Wolski 2012 年 10 月 18 日

0 投票

Hi Isabel,
You pass in a three dimensional image volume the same way you pass in a two dimensional image. Here is an example:
load mri;
D = padarray(squeeze(D),[5 5 5]); %make bigger
D2 = imtranslate(D,[2.7 -5.1 1.5]); %Translate the image a little bit so imregister has to work
[optim metric]= imregconfig('monomodal'); %build the optimizer
mr = imregister(D2,D,'rigid',optim,metric); %register
imtranslate can be found here.

7 件のコメント

Matt J
Matt J 2012 年 10 月 18 日
Hmmm. Have you actually tried this? According to my documentation (R2012a), the inputs to imregister have to be 2D.
Sean de Wolski
Sean de Wolski 2012 年 10 月 18 日
New in R2012b :)
Isabel
Isabel 2012 年 10 月 18 日
Hi Sean,
I do as you posted but I'm getting this error all the time, can you help me with that?
Error using regmex
An exception occurred during registration.
Check the optimization and metric configurations.
The ITK exception was: Failed to allocate memory for image.
Error in imregister (line 152)
[rotationMatrix, translationVector] = ...
Thanks
Sean de Wolski
Sean de Wolski 2012 年 10 月 18 日
Did you copy what I have above exactly and download imtranslate?
Isabel
Isabel 2012 年 10 月 18 日
Yes but when I tried to compare two different set of data is giving the error that I wrote before. The point is that I should be able to register to different set of data, for example, mr1 and mr2 where mr1 is the fixed input and mr2 is the moving input.
Sean de Wolski
Sean de Wolski 2012 年 10 月 18 日
Yes, and it does! At least for me with the above example. It's hard to say what's causing the error you're seeing since I don't know anything about mr1/mr2 and how you're calling imregister
Isabel
Isabel 2012 年 10 月 18 日
Dear Sean, now it is working. I just restarted the computer and try it from the beginning and now no erros =)
Thank you for your help

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeGeometric Transformation and Image Registration についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by