[Insight-users] Re: SetFixedImageRegion
Luis Ibanez
luis.ibanez at kitware.com
Tue Aug 31 18:00:45 EDT 2004
Hi Wei,
Please do the following:
1) Stop writing code.
2) Read the section of resampling from the
ITK Software Guide.
http://www.itk.org/ItkSoftwareGuide.pdf
Section 6.7.1, pdf-pages 199 to 218.
3) Read the Chapter on Image Registration from
the ITK SoftwareGuide. This is Chapter 8,
pdf-pages 241 - 328.
All the Examples available in
Insight/Examples/Registration
are explained in this Chapter of the software
guide. To be more precise, the examples *are*
the SoftwareGuide.
Please let us know if you have any questions
after reading this material,
Thanks
Luis
--------------------
Wei-Lin Bee wrote:
> Hi Luis,
>
> You're right. My image files come from one modality. Sorry for misleading
> you and thank you for correcting me immediately before I go too far.
>
> As for this case (roughly 5mm X 20mm overlap between 20mm X 20mm images),
> Due to lack of generic programming knowledge, although you've already given me
> clear direction and the next step I should follow, however, I don't exactly
> know how to do.
>
> A.What I learned from API is:
> In itk::ImageRegistrationMethod, there is SetFixedImageRegion function needed
> to be instantiated?
>
> B.So I try to get similar code from Insight/Examples/Registration:
>
> 1.ImageRegistration1~14:
>
> registration->SetFixedImageRegion(
> fixedImageReader->GetOutput()->GetBufferedRegion() );
>
> or
>
> registration->SetFixedImageRegion(
> fixedNormalizer->GetOutput()->GetBufferedRegion() );
>
> 2.MeanSquaresImageMetric1
>
> metric->SetFixedImageRegion(fixedImage->GetBufferedRegion());
>
> 3.MultiResImageRegistration1~2
>
> registration->SetFixedImageRegion(
> fixedCaster->GetOutput()->GetBufferedRegion() );
>
>
> 4.DeformableRegistration6
>
> FixedImageType::RegionType fixedRegion = fixedImage->GetBufferedRegion();
> registration->SetFixedImageRegion( fixedRegion );
>
> It seems that all of the examples are using full available content of images.
>
> C. Finally, I seemingly got some hints from [Insight-users] mailing list
> archives:
>
> ex.http://public.kitware.com/pipermail/insight-users/2004-March/007391.html
>
> metric->SetMovingImageStandardDeviation(1.0);
> metric->SetFixedImageStandardDeviation(1.0);
> metric->SetFixedImageRegion(fixedImg->GetBufferedRegion());
> metric->SetNumberOfSpatialSamples(1000);
>
> However, I think asking for a complete and accurate answer should be the best
> way to learn ITK. (much better than aimless copy and paste myself)
> On the other hand, I have wasted too much time(3 weeks)trial error in this test
> sample registration(later, I have to apply ITK in 2D, 3D tissue images from 16
> channel two-photon microscopy). I got go faster.
>
>
>
> Thanks abound !
>
>
> Best,
> Tiger
>
>
>
> Quoting Luis Ibanez <luis.ibanez at kitware.com>:
>
>
>>Hi Tiger,
>>
>>
>>1) It sounds like you are doing stitching in microscopy or
>> creating a mosaic for video or satelite images.
>>
>> Is that the case ?
>>
>>
>>2) The subject of your email says "Inter-Modality", but...
>> if you are doning stitching, it is unlikely that your
>> images are actually from multiple modalities...
>>
>> Please clarify:
>>
>> Are the images of the same modality or not ?
>>
>>
>>3) If you are doing stiching you can solve the registration
>> of every pair of images by setting the FixedImageRegion
>> to the expected overlap (5mm x 20mm) and by making sure
>> that you assign to all the images, values of pixel spacing
>> and image origin that correspond roughly to their correct
>> location in space. That will simplify a lot the registration.
>>
>>
>>4) If you are doing this for Microscopy you may want to start
>> with the following components:
>>
>> - NormalizedCorrelationMetric
>> - TranslationTransform
>> - LinearInterpolator
>> - RegularStepGradientDescentOptimizer
>>
>>
>>5) Make sure that you connect an Observer to the optimizer
>> and you plot the values of the metric as the iterations
>> proceed. That will guide in the process of fine tunning
>> registration parameters. Keep in mind that you cannot
>> trust an optimizer, you must supervise its progress and
>> drive its parameters in order to obtain reasonable results.
>> The use of command observers is illustrated in almost all
>> the registration examples in
>>
>> Insight/Examples/Registration
>>
>>
>>
>>
>> Regards,
>>
>>
>> Luis
>>
>>
>>
>>-------------------------
>>Wei-Lin Bee wrote:
>>
>>
>>>Hi,
>>>
>>>I have 64 spacial image files (8 X 8)to be registered. The size of each
>>
>>image is
>>
>>>20mm X 20mm which overlap partion between two images would be 5mm X 20mm.
>>
>>I
>>
>>>learned from itkSoftwareGuide that there seems no clear-cut rules in
>>
>>choosing
>>
>>>matric, however I failed to solve this problem for days. Any reply would
>>
>>be
>>
>>>appreciated.
>>>
>>>
>>>
>>>Thank you very much.
>>>
>>>
>>>Best,
>>>Tiger
>>>_______________________________________________
>>
>>
>>
>>
>>
>
>
More information about the Insight-users
mailing list