[Insight-users] deformable registration 3D

Luis Ibanez luis.ibanez at kitware.com
Wed, 28 Apr 2004 19:50:00 -0400


Hi Christoph,

Please be nice and send us your modified .cxx file   :-)

It is hard to make autopsies from only pictures
of the dead body...


   Thanks,


    Luis


--------------------------
Christoph Albrecht wrote:

> Hi Luis,
>  
> I added these two lines (typedef::itk...) to the source code in 
> deformableregistration1.cxx, direclty before the part of writing (around 
> line 265). Unfortunately, this changed nothing. The output is still 8 
> bit, the same as before.
>  
> Also deleting the resampling part did not work. I deleted lines 230-260, 
> rescale and histogram. Now there is an error as the following:
>  
> --------------------------------------------------------
> Microsoft Visual C++ Debug Library
> Debug Error!
> Program: DeformableRegistration1.exe
> abnormal program termination
> (Press Retry to debug the application)
> Cancel   Retry   Ignore
> --------------------------------------------------------
>  
> Hitting Retry leads to
>  
> -------------------------------------------------------------
> unknown software exception (0x80000003)
> --------------------------------------------------------------
>  
> and
>  
> --------------------------------------------------------------------------------
> Call to Userdefined Stop in Source Code at 0x1020b1f3
> --------------------------------------------------------------------------------
>  
> If the 16 bit output does not work, I have the idea of registering the 
> original image to itself to get exactly the same file format. But the 
> rescaling kills the substraction, the most important part of the work.
> Once again I have to ask for your help, especially with the rescaling.
>  
> Best regards
>    Christoph
>  
>  
>  
>  
>  
> 
>     ----- Original Message -----
>     *From:* Luis Ibanez <mailto:luis.ibanez at kitware.com>
>     *To:* Christoph Albrecht <mailto:christoph.albrecht at hamburg.de>
>     *Cc:* Insight-users at itk.org <mailto:Insight-users at itk.org>
>     *Sent:* Wednesday, April 28, 2004 4:07 PM
>     *Subject:* Re: [Insight-users] deformable registration 3D
> 
> 
>     Hi Christoph
> 
>     Thanks for letting us know that the
>     registration is now working for you.
> 
>     About the output:
> 
>        if you want to get image files in 16bit/pixel
>        You should simply instantiate the writers as
> 
> 
>        typedef itk::Image< unsigned short, Dimension > OutputImageType;
>        typedef itk::ImageFileWriter< OutputImageType > WriterType;
> 
> 
>     Note that the image that you connect to the writer in SetInput()
>     *must* be of pixel type "unsigned short". If you need a
>     conversion you could to casting with:
> 
>         CastImageFilter
>         RescaleIntensityImageFilter
>         IntensityWindowingImageFilter
> 
>     or any of the other filters described in Section 6.2
>     "Casting and Intensity Mapping", pdf-page 146 on the
>     SoftwareGuide.
> 
>        http://www.itk.org/ItkSoftwareGuide.pdf
> 
> 
>     Feel free to delete the resampling part. If you want to
>     do subtraction you may want to use the SquaredDifference
>     image filter. You will find examples on the use of this
>     filter the follwing files:
> 
>         Insight/Examples/Registration/
>                    DeformableRegistration4.cxx
>                    ImageRegistration1.cxx
>                    ImageRegistration10.cxx
>                    ImageRegistration5.cxx
>                    ImageRegistration6.cxx
>                    ImageRegistration7.cxx
>                    ImageRegistration8.cxx
>                    ImageRegistration9.cxx
> 
> 
>     Regards,
> 
> 
>         Luis
> 
> 
>     ----------------------------
>     Christoph Albrecht wrote:
> 
>      > Dear Luis,
>      >
>      > Many Thanks. I changed all file types to the correspondend 3D
>     types, now it
>      > works fine. The relative path was no problem anymore.
>      > Now I have one more thing:
>      > The input files are 16 bit files, ANALYZE format. The output
>     files are also
>      > ANALYZE, but only 8 bit. Can I change the output somewhere to 16
>     bit? In the
>      > internet I found the information that it is short integer.
>      > I was also thinking of deleting the whole rescaling part, because
>     after the
>      > registration I want to substract the original, fixed image from
>     the result
>      > to see a distribution of a contrast medium.
>      >
>      > Best regards
>      >    Christoph
>      >
>      >
>      >
>      >
>      >
>      >
>      > ----- Original Message -----
>      > From: "Luis Ibanez" <luis.ibanez at kitware.com
>     <mailto:luis.ibanez at kitware.com>>
>      > To: "Christoph Albrecht" <chrisalb at upvnet.upv.es
>     <mailto:chrisalb at upvnet.upv.es>>
>      > Cc: <insight-users at itk.org <mailto:insight-users at itk.org>>
>      > Sent: Monday, April 26, 2004 7:00 PM
>      > Subject: Re: [Insight-users] deformable registration 3D
>      >
>      >
>      >
>      >>Hi Christoph,
>      >>
>      >>Did you changed the Dimension from 2 to 3
>      >>in the .cxx file and recompiled  ?
>      >>
>      >>The error message is sayikng that the
>      >>image filename was not found.
>      >>
>      >>You are writing a relative path in the
>      >>specification of the input Moving and
>      >>Fixed image files.
>      >>
>      >>Could you please try with an absolute
>      >>path ?
>      >>
>      >>Please let us know if that works or not.
>      >>
>      >>
>      >>   Thanks
>      >>
>      >>
>      >>     Luis
>      >>
>      >>
>      >>----------------------------
>      >>Christoph Albrecht wrote:
>      >>
>      >>
>      >>>Hello,
>      >>>
>      >>>I tried to use the example "deformableregistration1" for a 3D
>     problem
>      >
>      > instead of the given 2D problem.
>      >
>      >>>The result was always 2D, the first slice of my ANALYZE data
>     registered.
>      >>>In an old post I found this problem solved by adding a third 1
>     to the
>      >
>      > "scaling at lowest level of pyramid", but this leads to the error
>     message:
>      >
>      >>>%---------------------------------------------------
>      >>>Exception caught during reference file reading
>      >>>
>      >>>itk::ImageFileReaderException (010DFB2C)
>      >>>Location: "Unknown"
>      >>>File: ......\IO\itkImageFileReader.txx
>      >>>Line: 91
>      >>>Description: FileName must be specified
>      >>>%----------------------------------------------------
>      >>>
>      >>>My configuration file looks like the following, I have only
>     changed the
>      >
>      > dimensions, the file names and the third 1:
>      >
>      >>>% ---------------------------------------------------------
>      >>>1 % Number of levels in the multi-res pyramid (1 = single-res)
>      >>>1 % Highest level to use in the pyramid
>      >>> 1 1 1    % Scaling at lowest level of pyramid
>      >>> 4  % Number of pixels per element
>      >>> 1.e4         % Elasticity (E)
>      >>> 1.e4         % Density x capacity (RhoC)
>      >>> 1  % Image energy scaling (gamma) - sets gradient step size
>      >>> 2  % NumberOfIntegrationPoints
>      >>> 1    % WidthOfMetricRegion
>      >>> 20  % MaximumIterations
>      >>>
>      >>>0 0.99  % Similarity metric (0=mean sq, 1 = ncc, 2=pattern int,
>     3=MI,
>      >
>      > 5=demons)
>      >
>      >>>1.0 % Alpha
>      >>>0 % DescentDirection (1 = max, 0 = min)
>      >>>0 % DoLineSearch (0=never, 1=always, 2=if needed)
>      >>>1.e1 % TimeStep
>      >>>0.5     % Landmark variance
>      >>>0       % Employ regridding / enforce diffeomorphism ( >= 1 -> true)
>      >>>
>      >>>512 % Nx (image x dimension)
>      >>>512 % Ny (image y dimension)
>      >>>24   % Nz (image z dimension - not used if 2D)
>      >>>./___FEM/000000310000001x01.hdr  % ReferenceFileName
>      >>>./___FEM/000000310000001x02.hdr  % TargetFileName
>      >>>
>      >>>0 % UseLandmarks? - read the file name below if this is true
>      >>>- % LandmarkFileName
>      >>>./___FEM/RatLung_result                       % ResultsFileName
>     (prefix
>      >
>      > only)
>      >
>      >>>1       % WriteDisplacementField?
>      >>>./___FEM/RatLung_disp                         %
>     DisplacementsFileName
>      >
>      > (prefix only)
>      >
>      >>>0       % ReadMeshFile?
>      >>>-                                      % MeshFileName
>      >>>END
>      >>>%-----------------------------------------------------------------------
>      >>>
>      >>>
>      >>>I would be glad if somebody could help me with this.
>      >>>
>      >>>Many thanks
>      >>>   Christoph Albrecht
>      >>>
>      >>>_______________________________________________
>      >>>Insight-users mailing list
>      >>>Insight-users at itk.org
>      >>>http://www.itk.org/mailman/listinfo/insight-users
>      >>>
>      >>
>      >>
>      >>
>      >
>      >
> 
>