[Insight-users] Imagemask for registration: possible to create non-structured mask?
Luis Ibanez
luis.ibanez at kitware.com
Tue Feb 23 17:07:00 EST 2010
Hi Michiel,
0) ITK can register images even if they don't have the same
origin, spacing, number of pixels or orientation.
1) The error that you are observing is very common.
Its typical causes are:
a) Poorly initialized Transform
b) Optimizer with search parameters that are too aggressive.
If you see the error message in the first iteration, you must
suspect that the cause is (a). If you see the error after several
iterations of the optimizer, then you must suspect that the
likely cause is (b).
---
You must start by providing a reasonable initialization
for the Transform.
Are you using any of the Transform initializers ?
When the transform is initialized correctly, it should be
possible to resample the Moving image into the coordinate
system of the Fixed image and see a large overlap between
them.
Regards,
Luis
---------------------------------------------------------------------------------------
On Tue, Feb 23, 2010 at 6:13 AM, michiel mentink
<michael.mentink at st-hughs.ox.ac.uk> wrote:
> thank you Luis, the source code compiles and links now.
>
> However, I get this runtime error:
>
> Starting proces...
>
> ExceptionObject caught !
>
> itk::ExceptionObject (0x998f420)
> Location: "void itk::MeanSquaresImageToImageMetric<TFixedImage,
> TMovingImage>::GetValueAndDerivative(const typename
> itk::ImageToImageMetric<TFixedImage,
> TMovingImage>::TransformParametersType&, typename
> itk::ImageToImageMetric<TFixedImage, TMovingImage>::MeasureType&, typename
> itk::ImageToImageMetric<TFixedImage, TMovingImage>::DerivativeType&) const
> [with TFixedImage = itk::Image<float, 3u>, TMovingImage = itk::Image<float,
> 3u>]"
> File:
> /MMprogs/src/ITK_src/Code/Algorithms/itkMeanSquaresImageToImageMetric.txx
> Line: 364
> Description: itk::ERROR: MeanSquaresImageToImageMetric(0x99423f0): All the
> points mapped to outside of the moving image
>
>
> Just to be sure, I swapped moving and fixed image around and that didn't
> help...
>
> I'd like to troubleshoot what is going wrong. If I understand correctly (and
> correct me if I'm wrong), the register algorithm tries to compare points
> that are outside one of the images. Both images do not have the same size,
> one of them is approximately half the size of the other.
>
> Can anybody give me some ideas how to get information about point coordinate
> locations etc?
>
> cheers, Michael
>
> On Mon, Feb 22, 2010 at 11:34 PM, Luis Ibanez <luis.ibanez at kitware.com>
> wrote:
>>
>> Hi Michiel,
>>
>> Why do you want to use a non-structured 3D mask, if you already
>> have a binary mask from your segmentation, and you just need
>> to connect it to the itk::ImageMaskSpatialObject ?
>>
>> Please look at the example:
>>
>> Insight/Examples/Registration/
>> ImageRegistration12.cxx
>>
>> It shows how to use image masks in a registration process.
>>
>> Regards,
>>
>>
>> Luis
>>
>>
>> --------------------------------------------
>> On Mon, Feb 22, 2010 at 12:23 PM, michiel mentink
>> <michael.mentink at st-hughs.ox.ac.uk> wrote:
>> >
>> > I have a segmented 3D volume in binary format (foreground, background).
>> >
>> > I'd like to convert this into an image mask, so I can rigidly register
>> > the
>> > segmented volume, using the mask, to its' original, unsegmented volume.
>> > (I'm basically extending the imageRegistration8 example).
>> >
>> > Is it possible to create a non-structured 3D mask? (with random entries
>> > for mask points)
>> >
>> > Has anybody got an example how to do so?
>> >
>> > cheers,
>> > Michael
>> >
>> > _____________________________________
>> > Powered by www.kitware.com
>> >
>> > Visit other Kitware open-source projects at
>> > http://www.kitware.com/opensource/opensource.html
>> >
>> > Kitware offers ITK Training Courses, for more information visit:
>> > http://www.kitware.com/products/protraining.html
>> >
>> > Please keep messages on-topic and check the ITK FAQ at:
>> > http://www.itk.org/Wiki/ITK_FAQ
>> >
>> > Follow this link to subscribe/unsubscribe:
>> > http://www.itk.org/mailman/listinfo/insight-users
>> >
>> >
>
>
More information about the Insight-users
mailing list