[Insight-users] How to calculate displacement from deformation field
Li Yufei
yli at research.balgrist.ch
Tue Nov 25 04:33:40 EST 2008
Hi all,
I have been working with some deformation fields generated from my demons registration. I am able to view the field in paraview with no problem. What I really want is to quantify the displacement (max, min, average displacement) and subsequently the strains.
I tried to read the field to matlab and I found that for an image size of 300*300*100, there are 300*300*100*12 elements in the field. so I guess for each pixel, there are 12 numbers specifying the deformation. Can someone tell me what are these 12 elements? or anyone has an idea how to calculate the displacement? Thank you very much.
Best regards
Yufei
-----Original Message-----
From: insight-users-bounces at itk.org on behalf of insight-users-request at itk.org
Sent: Mon 24.11.2008 13:56
To: insight-users at itk.org
Subject: Insight-users Digest, Vol 55, Issue 53
Send Insight-users mailing list submissions to
insight-users at itk.org
To subscribe or unsubscribe via the World Wide Web, visit
http://www.itk.org/mailman/listinfo/insight-users
or, via email, send a message with subject or body 'help' to
insight-users-request at itk.org
You can reach the person managing the list at
insight-users-owner at itk.org
When replying, please edit your Subject line so it is more specific
than "Re: Contents of Insight-users digest..."
Today's Topics:
1. Re: How to load sequence items (Branislav Goga)
2. Problem with Multiplying Two Complex Images, and a big thanks
to ITK community for this extensive body of work! (Saurabh Sethi)
3. MeanSquaresImageToImageMetric: Too many samples map outside
moving image buffer (Urlek)
4. Re: Problem with Multiplying Two Complex Images, and a big
thanks to ITK community for this extensive body of work! (Dan Mueller)
----------------------------------------------------------------------
Message: 1
Date: Mon, 24 Nov 2008 02:19:03 -0800 (PST)
From: Branislav Goga <brano.goga at centrum.sk>
Subject: Re: [Insight-users] How to load sequence items
To: insight-users at itk.org
Message-ID: <20658096.post at talk.nabble.com>
Content-Type: text/plain; charset=us-ascii
Thank you, I`ll have a look at it. Looks usable. :)
--
View this message in context: http://www.nabble.com/How-to-load-sequence-items-tp20622657p20658096.html
Sent from the ITK - Users mailing list archive at Nabble.com.
------------------------------
Message: 2
Date: Mon, 24 Nov 2008 12:22:44 +0000
From: "Saurabh Sethi" <sethi.saurabh at gmail.com>
Subject: [Insight-users] Problem with Multiplying Two Complex Images,
and a big thanks to ITK community for this extensive body of work!
To: insight-users at itk.org
Message-ID:
<c596bdc20811240422u7ed9973lfad732751984c22a at mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
Hi All,
I recently started using the ITK after a lot of word of mouth publicity from
peer groups :)
And I must say that im very impressed by it.
Have been going through all of the Software guide and Message Archives since
some time now.
I have a bit of problem with the FFT / IFFT implementation. There is some
"Access Violation" that I'm unable to fix since some time.
Maybe I have used the Complex Image in a wrong ( read Silly) way which I'm
unable to debug now.
It would be great if someone could help ->
I need to convolve two images (one is the test image, and other is my data
image)
For this, I had thought of first doing the FFT, then Multiplying both the
images and taking the IFFT in the end.
Here is my pseudo code:
read image 1 (im1)
Padd the image to nearest power of 2.
compute its FFT. (I'm using FFTRealToComplexConjugateImageFilter)
read image 2. (im2)
Padd the image to the same power of 2.
compute its FFT.
Multiply both the images
MultiplyImageFilter->SetInput1(fft_input);
MultiplyImageFilter->SetInput2(fft_weight);
MultiplyImageFilter->Update();
IT is here that this strange error occurs:
Unhandled exception at 0x0046193a in ItkScatter.exe: 0xC0000005: Access
violation reading location 0x61371000.
And the code breaks in at this place in file
itkDefaultPixelAccessorFunctor.h:
inline const ExternalPixelType Get( const InternalPixelType & input ) const
{
return m_PixelAccessor.Get( input );
}
Below is the relevant part of the code:
typedef itk::FFTRealToComplexConjugateImageFilter<pixelTypeC, dim2D>
FFTFilterType;
typedef itk::FFTComplexConjugateToRealImageFilter<pixelTypeC, dim2D>
IFFTFilterType;
typedef FFTFilterType::OutputImageType ComplexImageType;
typedef itk::MultiplyImageFilter<ComplexImageType, ComplexImageType,
ComplexImageType>MultiplyImageFilterType;//>
constPadImage->SetPadLowerBound(paddin);// specifying padding options
constPadImage->SetPadUpperBound(paddin);
constPadImage->SetInput(inputImage_C); // set padding filter input.
fftFilter->SetInput(constPadImage->GetOutput()); //set the fft.
ComplexImageType::Pointer fft_input = fftFilter->GetOutput(); // fft filter
done on image.
fftFilter->Update();
constPadImage2->SetPadUpperBound(paddin_wt_upper);
constPadImage2->SetInput(inputImage2); // set padding filter input.
fft_wtFilter->SetInput(constPadImage2->GetOutput()); //set the fft.
ComplexImageType::Pointer fft_weight= fft_wtFilter->GetOutput();// fft
filter done on image.
fft_wtFilter->Update();
MultiplyImageFilter->SetInput1(fft_input);
MultiplyImageFilter->SetInput2(fft_weight);
MultiplyImageFilter->Update() // Error occurs here.
ifftFilter->SetInput(MultiplyImageFilter->GetOutput());
ifftFilter->Update();
Hi,Many thanks
Saurabh
New ITKer..
2008/11/21 chensiqi <pidanchen at hotmail.com>
>
> Hi, ITKers,
>
> Does anybody know how to load sequence items using ITK? Such as "ROI
> Contour Sequence".
> Or if you know how to do it in GDCM, and integrate into ITK, that will also
> be very helpful.
>
> Thanks
> Siqi
>
>
> ------------------------------
> ??????????MSN??? ????? <http://cn.msn.com/>
>
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20081124/f934fc9a/attachment-0001.htm>
------------------------------
Message: 3
Date: Mon, 24 Nov 2008 04:29:29 -0800 (PST)
From: Urlek <crapie at email.si>
Subject: [Insight-users] MeanSquaresImageToImageMetric: Too many
samples map outside moving image buffer
To: insight-users at itk.org
Message-ID: <20660013.post at talk.nabble.com>
Content-Type: text/plain; charset=us-ascii
Hi,
I am trying to register two considerably (but purposely) offset images
that share only approx. 30% of the surface. Somehow,
MeanSquaresImageToImageMetric throws the following exception:
itk::ExceptionObject (000000000113CC88)
Location: "void __cdecl itk::MeanSquaresImageToImageMetric<class
itk::Image<float,3>,class itk::Image<float,3> >::GetValueAndDerivative(const
class itk::Array<double> &,double &,class itk::Array<double> &) const"
File:
e:\itk\insighttoolkit-3.8.0-src\code\review\itkOptMeanSquaresImageToImageMetric.txx
Line: 284
Description: itk::ERROR: MeanSquaresImageToImageMetric(0000000030CE1CE0):
Too many samples map outside moving image buffer: 219300 / 909500
This makes me wonder about the following questions:
1) Does that mean I have to cut out the regions that are likely to overlap
prior to the registration?
2) If so, is it possible to define a region of the image to be used in
registration without having to cut that region out into a smaller image?
3) Would some metric other than MeanSquaresImageToImageMetric work better?
Preferably another crosscorrelation-like one that supports multi-threading?
Thanks a lot!
--
View this message in context: http://www.nabble.com/MeanSquaresImageToImageMetric%3A-Too-many-samples-map-outside-moving-image-buffer-tp20660013p20660013.html
Sent from the ITK - Users mailing list archive at Nabble.com.
------------------------------
Message: 4
Date: Mon, 24 Nov 2008 13:54:48 +0100
From: "Dan Mueller" <dan.muel at gmail.com>
Subject: Re: [Insight-users] Problem with Multiplying Two Complex
Images, and a big thanks to ITK community for this extensive body of
work!
To: "Saurabh Sethi" <sethi.saurabh at gmail.com>
Cc: insight-users at itk.org
Message-ID:
<2b8d077d0811240454x884065jcf9bbaa4290dbe22 at mail.gmail.com>
Content-Type: text/plain; charset=GB2312
Hi Saurabh,
Welcome to ITK!
I can't respond regarding your FFT issues/questions, however if your
convolution kernels are small (or computation time is not an issue)
then you may consider computing the convolution directly.
Section 11.4 of the ITK Software Guide describes how to do this using
neighborhood iterators. This part of the software guide is generated
from:
Examples\Iterators\NeighborhoodIterators4.cxx
HTH
Regards, Dan
2008/11/24 Saurabh Sethi <sethi.saurabh at gmail.com>:
> Hi All,
>
> I recently started using the ITK after a lot of word of mouth publicity from
> peer groups :)
>
> And I must say that im very impressed by it.
>
> Have been going through all of the Software guide and Message Archives since
> some time now.
>
> I have a bit of problem with the FFT / IFFT implementation. There is some
> "Access Violation" that I'm unable to fix since some time.
>
> Maybe I have used the Complex Image in a wrong ( read Silly) way which I'm
> unable to debug now.
>
> It would be great if someone could help ->
>
>
>
> I need to convolve two images (one is the test image, and other is my data
> image)
>
> For this, I had thought of first doing the FFT, then Multiplying both the
> images and taking the IFFT in the end.
>
>
>
> Here is my pseudo code:
>
>
>
> read image 1 (im1)
>
> Padd the image to nearest power of 2.
>
> compute its FFT. (I'm using FFTRealToComplexConjugateImageFilter)
>
>
>
> read image 2. (im2)
>
> Padd the image to the same power of 2.
>
> compute its FFT.
>
>
>
> Multiply both the images
>
> MultiplyImageFilter->SetInput1(fft_input);
>
> MultiplyImageFilter->SetInput2(fft_weight);
>
> MultiplyImageFilter->Update();
>
>
>
> IT is here that this strange error occurs:
>
>
>
> Unhandled exception at 0x0046193a in ItkScatter.exe: 0xC0000005: Access
> violation reading location 0x61371000.
>
>
>
> And the code breaks in at this place in file
> itkDefaultPixelAccessorFunctor.h:
>
> inline const ExternalPixelType Get( const InternalPixelType & input ) const
>
> {
>
> return m_PixelAccessor.Get( input );
>
> }
>
>
>
>
>
> Below is the relevant part of the code:
>
>
>
> typedef itk::FFTRealToComplexConjugateImageFilter<pixelTypeC, dim2D>
> FFTFilterType;
>
> typedef itk::FFTComplexConjugateToRealImageFilter<pixelTypeC, dim2D>
> IFFTFilterType;
>
> typedef FFTFilterType::OutputImageType ComplexImageType;
>
> typedef itk::MultiplyImageFilter<ComplexImageType, ComplexImageType,
> ComplexImageType>MultiplyImageFilterType;//>
>
>
>
> constPadImage->SetPadLowerBound(paddin);// specifying padding options
>
> constPadImage->SetPadUpperBound(paddin);
>
> constPadImage->SetInput(inputImage_C); // set padding filter input.
>
> fftFilter->SetInput(constPadImage->GetOutput()); //set the fft.
>
> ComplexImageType::Pointer fft_input = fftFilter->GetOutput(); // fft filter
> done on image.
>
> fftFilter->Update();
>
>
>
> constPadImage2->SetPadUpperBound(paddin_wt_upper);
>
> constPadImage2->SetInput(inputImage2); // set padding filter input.
>
> fft_wtFilter->SetInput(constPadImage2->GetOutput()); //set the fft.
>
> ComplexImageType::Pointer fft_weight= fft_wtFilter->GetOutput();// fft
> filter done on image.
>
> fft_wtFilter->Update();
>
>
>
> MultiplyImageFilter->SetInput1(fft_input);
>
> MultiplyImageFilter->SetInput2(fft_weight);
>
> MultiplyImageFilter->Update() // Error occurs here.
>
> ifftFilter->SetInput(MultiplyImageFilter->GetOutput());
>
> ifftFilter->Update();
>
>
>
> Hi,Many thanks
>
> Saurabh
>
> New ITKer..
>
>
>
>
>
> 2008/11/21 chensiqi <pidanchen at hotmail.com>
>>
>>
>> Hi, ITKers,
>>
>> Does anybody know how to load sequence items using ITK? Such as "ROI
>> Contour Sequence".
>> Or if you know how to do it in GDCM, and integrate into ITK, that will
>> also be very helpful.
>>
>> Thanks
>> Siqi
>>
>>
>> ________________________________
>> ??????????MSN??? ?????
>> _______________________________________________
>> Insight-users mailing list
>> Insight-users at itk.org
>> http://www.itk.org/mailman/listinfo/insight-users
>>
>
>
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
>
>
------------------------------
_______________________________________________
Insight-users mailing list
Insight-users at itk.org
http://www.itk.org/mailman/listinfo/insight-users
End of Insight-users Digest, Vol 55, Issue 53
*********************************************
*****************************************************************
This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept by MIMEsweeper for content and by McAffee Webshield for the presence of computer viruses.
*****************************************************************
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/ms-tnef
Size: 9485 bytes
Desc: not available
URL: <http://www.itk.org/pipermail/insight-users/attachments/20081125/50f413d3/attachment-0001.bin>
More information about the Insight-users
mailing list