[Insight-users] itk neighborhood operator image filter error
raghu venkatram
raghu_420 at hotmail.com
Thu, 22 Apr 2004 17:33:41 +0000
<html><div style='background-color:'><DIV class=RTE>
<P>Hi Luis,</P>
<P>is there a way to create color dicom images? in the sense store a color map/palatte within the dicom files. </P>
<P>Thanks,</P>
<P>Raghu<BR><BR></P></DIV>
<DIV></DIV>>From: Luis Ibanez <luis.ibanez at kitware.com>
<DIV></DIV>>To: raghu venkatram <raghu_420 at hotmail.com>
<DIV></DIV>>CC: insight-users at itk.org
<DIV></DIV>>Subject: Re: [Insight-users] itk neighborhood operator image filter error
<DIV></DIV>>Date: Tue, 20 Apr 2004 21:01:16 -0400
<DIV></DIV>>
<DIV></DIV>>
<DIV></DIV>>Hi Raghu,
<DIV></DIV>>
<DIV></DIV>>If the metric value gets to a stable value you can
<DIV></DIV>>define a stopping criterion by using the Gradient
<DIV></DIV>>Magnitude Tolerance.
<DIV></DIV>>
<DIV></DIV>>In the case of the RegularStepGradientDescentOptimizer
<DIV></DIV>>http://www.itk.org/Insight/Doxygen/html/classitk_1_1RegularStepGradientDescentBaseOptimizer.html
<DIV></DIV>>
<DIV></DIV>>You call:
<DIV></DIV>>
<DIV></DIV>> SetGradientMagnitudeTolerance();
<DIV></DIV>>
<DIV></DIV>>The optimizer will stop when the magnitude
<DIV></DIV>>of the Metric gradient is less than this
<DIV></DIV>>value.
<DIV></DIV>>
<DIV></DIV>>The default value is : 1 e-4
<DIV></DIV>>
<DIV></DIV>>
<DIV></DIV>>You will find the code that controls the optimizer in
<DIV></DIV>>
<DIV></DIV>> Insight/Code/Numerics/
<DIV></DIV>> itkRegularStepGradientDescentBaseOptimizer.cxx
<DIV></DIV>>
<DIV></DIV>>In line 197.
<DIV></DIV>>
<DIV></DIV>>
<DIV></DIV>>----
<DIV></DIV>>
<DIV></DIV>>
<DIV></DIV>>If you use the RegularStepGradientDescent optimizer, the
<DIV></DIV>>step length is divided by two each time the gradient change
<DIV></DIV>>directions.
<DIV></DIV>>
<DIV></DIV>>
<DIV></DIV>>If you use the GradientDescent optimizer, the learning
<DIV></DIV>>rate is constant. You could however change it from the
<DIV></DIV>>Execute() method of a Command/Observer.
<DIV></DIV>>
<DIV></DIV>>
<DIV></DIV>>You will find the code for the GradientDescentOptimizer at
<DIV></DIV>>
<DIV></DIV>> Insight/Code/Numerics/
<DIV></DIV>> itkGradientDescentOptimizer.cxx
<DIV></DIV>>
<DIV></DIV>>
<DIV></DIV>>
<DIV></DIV>> Regards,
<DIV></DIV>>
<DIV></DIV>>
<DIV></DIV>> Luis
<DIV></DIV>>
<DIV></DIV>>
<DIV></DIV>>---------------------
<DIV></DIV>>raghu venkatram wrote:
<DIV></DIV>>>
<DIV></DIV>>>
<DIV></DIV>>>Hi Luis,
<DIV></DIV>>>
<DIV></DIV>>>Using the gradient descent optimizer, even with 2000 iterations, my
<DIV></DIV>>>registration does not converge. But my results do look good, as a
<DIV></DIV>>>plot of my iterations vs my metric, my metric kind of flattens out
<DIV></DIV>>>after a certain number of iterations.
<DIV></DIV>>>
<DIV></DIV>>>my question is the learning rate constant throughout the process?
<DIV></DIV>>>or is it divided my the current iteration something like
<DIV></DIV>>>r/iteration no.?
<DIV></DIV>>>
<DIV></DIV>>>thanks,
<DIV></DIV>>>raghu
<DIV></DIV>>>
<DIV></DIV>>>&gt;From: Luis Ibanez &lt;luis.ibanez at kitware.com&gt;
<DIV></DIV>>>&gt;To: raghu venkatram &lt;raghu_420 at hotmail.com&gt;
<DIV></DIV>>>&gt;CC: insight-users at itk.org
<DIV></DIV>>>&gt;Subject: Re: [Insight-users] itk neighborhood operator image
<DIV></DIV>>>filter error
<DIV></DIV>>>&gt;Date: Tue, 20 Apr 2004 14:34:15 -0400
<DIV></DIV>>>&gt;
<DIV></DIV>>>&gt;
<DIV></DIV>>>&gt;Hi raghu,
<DIV></DIV>>>&gt;
<DIV></DIV>>>&gt;The optimizer scales do not need to be different among
<DIV></DIV>>>&gt;X, Y, and Z. Unless the anisotropy ratio as big as 1:10.
<DIV></DIV>>>&gt;
<DIV></DIV>>>&gt;The goal of the parameter scaling is to deal with large
<DIV></DIV>>>&gt;dynamic range differences such as degrees versus
<DIV></DIV>>>&gt;millimeters where the ratio is in the range of 1:100.
<DIV></DIV>>>&gt;
<DIV></DIV>>>&gt;If your metric plots shows the Metric behaving smoothly,
<DIV></DIV>>>&gt;you can take the risk of *increasing* (not decreasing)
<DIV></DIV>>>&gt;the step length of the optimizer, and probably reducing
<DIV></DIV>>>&gt;the number of iterations.
<DIV></DIV>>>&gt;
<DIV></DIV>>>&gt;Note however that if your registration is using all the
<DIV></DIV>>>&gt;allotted iterations, it means that it has not converged,
<DIV></DIV>>>&gt;and that you still have homework to do in parameter
<DIV></DIV>>>&gt;tunning.
<DIV></DIV>>>&gt;
<DIV></DIV>>>&gt;
<DIV></DIV>>>&gt;
<DIV></DIV>>>&gt; Regards,
<DIV></DIV>>>&gt;
<DIV></DIV>>>&gt;
<DIV></DIV>>>&gt; Luis
<DIV></DIV>>>&gt;
<DIV></DIV>>>&gt;
<DIV></DIV>>>&gt;
<DIV></DIV>>>&gt;------------------------
<DIV></DIV>>>&gt;raghu venkatram wrote:
<DIV></DIV>>>&gt;
<DIV></DIV>>>&gt;&gt;Hello Luis,
<DIV></DIV>>>&gt;&gt;
<DIV></DIV>>>&gt;&gt;Thank you for the tip, it was ofcourse my CT volume, I was
<DIV></DIV>>>only
<DIV></DIV>>>&gt;&gt;reading 2 slices. I am not sure why this is happening as I
<DIV></DIV>>>used
<DIV></DIV>>>&gt;&gt;MRICro to convert both my CT and MR volumes into mayo
<DIV></DIV>>>clinic
<DIV></DIV>>>&gt;&gt;analyze format and everything works fine. using ITK's dicom
<DIV></DIV>>>series
<DIV></DIV>>>&gt;&gt;reader reads my MR volume and am able to wrtie it out, but
<DIV></DIV>>>it dies
<DIV></DIV>>>&gt;&gt;on the third slice of my CT volume.
<DIV></DIV>>>&gt;&gt;
<DIV></DIV>>>&gt;&gt;Also regarding registration itself, i am using viola-wells
<DIV></DIV>>>mutual
<DIV></DIV>>>&gt;&gt;information, with gradient descent and the translation
<DIV></DIV>>>transform.
<DIV></DIV>>>&gt;&gt;in this set up should my my optimizer scales for x and y be
<DIV></DIV>>>equal
<DIV></DIV>>>&gt;&gt;to 1 while my optimizer scale for z slightly greater than
<DIV></DIV>>>1? my z
<DIV></DIV>>>&gt;&gt;in the volume is much smaller than the inplane dimensions.
<DIV></DIV>>>&gt;&gt;
<DIV></DIV>>>&gt;&gt;with a step size of 18 and 500 epochs, i am getting good
<DIV></DIV>>>results,
<DIV></DIV>>>&gt;&gt;and a final metric value of 0.2-0.4, a plot of the
<DIV></DIV>>>iteration vs
<DIV></DIV>>>&gt;&gt;metric shows that the metric is fairly stable with this,
<DIV></DIV>>>should i
<DIV></DIV>>>&gt;&gt;decrease the step size and increase the iterations further?
<DIV></DIV>>>&gt;&gt;
<DIV></DIV>>>&gt;&gt;
<DIV></DIV>>>&gt;&gt;
<DIV></DIV>>>&gt;&gt;thanks
<DIV></DIV>>>&gt;&gt;
<DIV></DIV>>>&gt;&gt;raghu
<DIV></DIV>>>&gt;&gt;
<DIV></DIV>>>&gt;&gt; &gt;From: Luis Ibanez &lt;luis.ibanez at kitware.com&gt;
<DIV></DIV>>>&gt;&gt; &gt;To: raghu venkatram &lt;raghu_420 at hotmail.com&gt;
<DIV></DIV>>>&gt;&gt; &gt;CC: insight-users at itk.org
<DIV></DIV>>>&gt;&gt; &gt;Subject: Re: [Insight-users] itk neighborhood
<DIV></DIV>>>operator image
<DIV></DIV>>>&gt;&gt;filter error
<DIV></DIV>>>&gt;&gt; &gt;Date: Mon, 19 Apr 2004 19:43:23 -0400
<DIV></DIV>>>&gt;&gt; &gt;
<DIV></DIV>>>&gt;&gt; &gt;
<DIV></DIV>>>&gt;&gt; &gt;Hi Raghu,
<DIV></DIV>>>&gt;&gt; &gt;
<DIV></DIV>>>&gt;&gt; &gt;It is likely that your process for reading the
<DIV></DIV>>>&gt;&gt; &gt;DICOM series is failing. The fact that it shows
<DIV></DIV>>>&gt;&gt; &gt;up in the Neighborhood iterator may simply indicate
<DIV></DIV>>>&gt;&gt; &gt;that you are reading an image of a single slice,
<DIV></DIV>>>&gt;&gt; &gt;for example.
<DIV></DIV>>>&gt;&gt; &gt;
<DIV></DIV>>>&gt;&gt; &gt;Please connect a ImageFileWriter directly to the
<DIV></DIV>>>&gt;&gt; &gt;output of the DicomSeries reader and save the
<DIV></DIV>>>&gt;&gt; &gt;image in another format. MetaImage will be the
<DIV></DIV>>>&gt;&gt; &gt;best choice since then you can look at the header
<DIV></DIV>>>&gt;&gt; &gt;and figure out what information from the DICOM
<DIV></DIV>>>&gt;&gt; &gt;file is getting lost on the way.
<DIV></DIV>>>&gt;&gt; &gt;
<DIV></DIV>>>&gt;&gt; &gt;Chances are that you only have a Input/Output
<DIV></DIV>>>&gt;&gt; &gt;problem and not a processing problem.
<DIV></DIV>>>&gt;&gt; &gt;
<DIV></DIV>>>&gt;&gt; &gt;
<DIV></DIV>>>&gt;&gt; &gt;I will also suggest you to try the example
<DIV></DIV>>>&gt;&gt; &gt;
<DIV></DIV>>>&gt;&gt; &gt; Insight/Examples/IO/
<DIV></DIV>>>&gt;&gt; &gt; DicomSeriesReadImageWrite.cxx
<DIV></DIV>>>&gt;&gt; &gt;
<DIV></DIV>>>&gt;&gt; &gt;for reading your Dicom images, and to make sure
<DIV></DIV>>>&gt;&gt; &gt;that you are using the series reader correctly.
<DIV></DIV>>>&gt;&gt; &gt;
<DIV></DIV>>>&gt;&gt; &gt;For example, note that you should specify the
<DIV></DIV>>>&gt;&gt; &gt;string identifying the series to be read.
<DIV></DIV>>>&gt;&gt; &gt;
<DIV></DIV>>>&gt;&gt; &gt;
<DIV></DIV>>>&gt;&gt; &gt;Please let us know what you find.
<DIV></DIV>>>&gt;&gt; &gt;
<DIV></DIV>>>&gt;&gt; &gt;
<DIV></DIV>>>&gt;&gt; &gt;
<DIV></DIV>>>&gt;&gt; &gt; Thanks,
<DIV></DIV>>>&gt;&gt; &gt;
<DIV></DIV>>>&gt;&gt; &gt;
<DIV></DIV>>>&gt;&gt; &gt; Luis
<DIV></DIV>>>&gt;&gt; &gt;
<DIV></DIV>>>&gt;&gt; &gt;
<DIV></DIV>>>&gt;&gt; &gt;-----------------------
<DIV></DIV>>>&gt;&gt; &gt;raghu venkatram wrote:
<DIV></DIV>>>&gt;&gt; &gt;&gt;Hello Luis,
<DIV></DIV>>>&gt;&gt; &gt;&gt; I am trying to register a MR and CT image using
<DIV></DIV>>>ImagetoImage
<DIV></DIV>>>&gt;&gt; &gt;&gt;mutual information measure, I have no problems
<DIV></DIV>>>whatsoever using
<DIV></DIV>>>&gt;&gt;the
<DIV></DIV>>>&gt;&gt; &gt;&gt;analyze image format.
<DIV></DIV>>>&gt;&gt; &gt;&gt; when i switch to dicom, and use the series
<DIV></DIV>>>reader, i can read
<DIV></DIV>>>&gt;&gt; &gt;&gt;both the series, but my program terminates with
<DIV></DIV>>>an error window
<DIV></DIV>>>&gt;&gt; &gt;&gt;asking me to notify microsoft, debug option takes
<DIV></DIV>>>me to the
<DIV></DIV>>>&gt;&gt; &gt;&gt;itkneighborhoodoperator filter.
<DIV></DIV>>>&gt;&gt; &gt;&gt; is there something obvious that i am doing
<DIV></DIV>>>wrong? my image
<DIV></DIV>>>&gt;&gt;types
<DIV></DIV>>>&gt;&gt; &gt;&gt;are unsigned short 3 dimensions.
<DIV></DIV>>>&gt;&gt; &gt;&gt; thanks,
<DIV></DIV>>>&gt;&gt; &gt;&gt;raghu
<DIV></DIV>>>&gt;&gt; &gt;&gt;
<DIV></DIV>>>&gt;&gt; &gt;
<DIV></DIV>>>&gt;&gt; &gt;
<DIV></DIV>>>&gt;&gt; &gt;_______________________________________________
<DIV></DIV>>>&gt;&gt; &gt;Insight-users mailing list
<DIV></DIV>>>&gt;&gt; &gt;Insight-users at itk.org
<DIV></DIV>>>&gt;&gt; &gt;http://www.itk.org/mailman/listinfo/insight-users
<DIV></DIV>>>&gt;&gt;
<DIV></DIV>>>&gt;&gt;------------------------------------------------------------------------
<DIV></DIV>>>
<DIV></DIV>>>&gt;&gt;Check out MSN PC Safety &amp; Security to help ensure your
<DIV></DIV>>>PC is
<DIV></DIV>>>&gt;&gt;protected and safe.
<DIV></DIV>>>&lt;http://g.msn.com/8HMAENUS/2749??PS=&gt;
<DIV></DIV>>>&gt;&gt;_______________________________________________
<DIV></DIV>>>Insight-users
<DIV></DIV>>>&gt;&gt;mailing list Insight-users at itk.org
<DIV></DIV>>>&gt;&gt;http://www.itk.org/mailman/listinfo/insight-users
<DIV></DIV>>>&gt;
<DIV></DIV>>>&gt;
<DIV></DIV>>>&gt;
<DIV></DIV>>>
<DIV></DIV>>>_________________________________________________________________
<DIV></DIV>>>
<DIV></DIV>>>>From must-see cities to the best beaches, plan a getaway with the
<DIV></DIV>>>>Spring
<DIV></DIV>>>
<DIV></DIV>>>Travel Guide! http://special.msn.com/local/springtravel.armx
<DIV></DIV>>>
<DIV></DIV>>>
<DIV></DIV>>
<DIV></DIV>>
<DIV></DIV>>
<DIV></DIV>>_______________________________________________
<DIV></DIV>>Insight-users mailing list
<DIV></DIV>>Insight-users at itk.org
<DIV></DIV>>http://www.itk.org/mailman/listinfo/insight-users
<DIV></DIV></div><br clear=all><hr> <a href="http://g.msn.com/8HMAENUS/2734??PS=">FREE pop-up blocking with the new MSN Toolbar – get it now!</a> </html>