[ITK-users] FW: intensity based 2d 3d registration

Matt McCormick matt.mccormick at kitware.com
Fri Nov 18 17:58:17 EST 2016


Hi,

Thanks for sharing the code and data.

After a little investigation, it appears that the wrapping is working
fine, but some tweaks may be required in the spatial parameters (?).
Current work is uploaded here:

http://review.source.kitware.com/#/c/21775/

I noted that movCenter computation was not generating the correct
value and fixed it. Also, since the ITKv4 registration method works
more like a traditional pipeline filter, it is important to change the
fixed image Origin with an itk.ChangeInformationImageFilter so it does
not get re-set on a pipeline update.

The test currently outputs:

  Starting registration
M: 0.000000   P: 0.000000 0.000000
WARNING: In
/home/matt/src/ITK/Modules/Numerics/Optimizersv4/include/itkObjectToObjectMetric.hxx,
line 529
MeanSquaresImageToImageMetricv4 (0x336c9d0): No valid points were found during
metric evaluation. For image metrics, verify that the images overlap
appropriately. For instance, you can align the image centers by translation.
For point-set metrics, verify that the fixed points, once transformed into the
virtual domain space, actually lie within the virtual domain.


Thanks,
Matt

On Tue, Nov 15, 2016 at 1:38 PM, D'Isidoro  Fabio <fisidoro at ethz.ch> wrote:
> In the zip folder you find the (slightly modified) code, the small 3D volume and relative DRR. I guess the extrinsic parameters for generation of the DRR (i.e. position of the 3D volume in the image coordinate system) is not relevant at the moment.
>
> Thank you!
> Fabio
>
> -----Original Message-----
> From: Matt McCormick [mailto:matt.mccormick at kitware.com]
> Sent: Dienstag, 15. November 2016 19:30
> To: D'Isidoro Fabio <fisidoro at ethz.ch>
> Cc: insight-users at itk.org
> Subject: Re: [ITK-users] FW: intensity based 2d 3d registration
>
> Hallo,
>
> Could you please share the small volumes are used? With the data and the code, we can add this as a test case, and get the test passing :-).
>
> Thanks,
> Matt
>
> On Mon, Nov 14, 2016 at 3:48 PM, D'Isidoro  Fabio <fisidoro at ethz.ch> wrote:
>> Hallo,
>>
>>
>>
>> I forward again my previous email hoping for a reply.
>>
>>
>>
>> Within the context of intensity based 2D-3D registration, can
>> RayCastInterpolateImageFunction be used with
>> ImageRegistrationMethodv4, as the other interpolators listed in the manual?
>> RayCastInterpolateImageFunction is not in the manual as the other
>> interpolators: does this mean that has not been implemented for use
>> with
>> ImageRegistrationMethodv4 (given that my code does not seem to work)?
>>
>>
>>
>> The problem why my code does not work is apparently not a memory issue
>> (I tried with a very very small 3D volume and the registration still
>> does not work).
>>
>>
>>
>> Thank you!
>>
>>
>>
>> From: D'Isidoro Fabio
>> Sent: Freitag, 11. November 2016 13:37
>> To: insight-users at itk.org
>> Subject: intensity based 2d 3d registration
>>
>>
>>
>> Hallo,
>>
>>
>>
>> I work on itk V4.10 (latest version) with Python wrapping. I am trying
>> to implement a basic intensity-based 2d3d registration, with a 3D
>> translation as transform and without multi-level or multi-stage registration.
>>
>> I could successfully reproduce with Python wrapping the DRR generation
>> code
>> (DigitallyReconstructedRadiograph1.cxx) and the 3D-3D registration
>> examples on the ITK manual (ImageRegistration8.cxx).
>>
>> I have combined now both for my 2D-3D registration, based on the
>> template I found on [1]. This template is however based on
>> registration method v3 and is more complex than the basic version I am
>> trying to implement (because it involves the Euler transform and multi-level approach).
>>
>>
>>
>> My basic version (in attachment) does not work, sometimes showing a
>> “Failed to allocate memory for image” and sometimes Python just
>> crashes (I could not figure out the reason for this difference). I
>> connected all components (optimizer, metric, fixed and moving
>> interpolator) the way I believe it makes sense, but I am not sure
>> whether ImageRegistrationMethodv4 supports the
>> RayCastInterpolateImageFunction and how it wants it to be connected
>> and initialized. The code fails at the registration.Update() command after a few seconds of running.
>>
>>
>>
>> My 3D volume is a 54 MB CT scan (360X450X160), I have reduced it from
>> the original one to try to avoid memory allocation problems.
>>
>>
>>
>> Is my code wrong? Also, how can I debug it if I can’t put breakpoints
>> “inside registration.Update()”?
>>
>>
>>
>> Looking forward to your help.
>>
>>
>>
>> Thank you,
>>
>> Fabio.
>>
>>
>>
>> [1]
>> https://github.com/InsightSoftwareConsortium/ITKApps/blob/master/Inten
>> sityBased2D3DRegistration/IntensityBased2D3DRegistration.cxx
>>
>>
>>
>>
>>
>>
>>
>>
>> _____________________________________
>> 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.php
>>
>> 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://public.kitware.com/mailman/listinfo/insight-users
>>


More information about the Insight-users mailing list