<DIV>Hi Luis,</DIV>  <DIV>&nbsp;</DIV>  <DIV>I'm not sure if this can help other users and can be applied in other scenarios.</DIV>  <DIV>I think if I explain it first will save us from&nbsp;the hustle and bustle.</DIV>  <DIV>1)I started by&nbsp;reading two DICOM CT <SPAN id=lw_1180218715_0><FONT color=#003399>datasets.To</FONT></SPAN> display&nbsp;simultaneously two 2D slices at the same position basically&nbsp;I&nbsp;duplicate all the CT handling code.I have&nbsp;m_ImageReader1+m_ImageReader2;m_ImageSpatialObject1+m_ImageSpatialObject2;</DIV>  <DIV>m_ImageRepresentationAxial1+m_ImageRepresentationAxial2 and so on.The only difference is that I set </DIV>  <DIV>&nbsp;</DIV>  <DIV>m_ImageRepresentationAxial1-&gt;SetOpacity( 0.5 );</DIV>  <DIV>m_ImageRepresentationAxial2-&gt;SetOpacity( 0.5 );</DIV>  <DIV>&nbsp;</DIV>  <DIV>This way I blend the two slices to get the appearance of one slice.</DIV>  <DIV>&nbsp;</DIV>  <DIV>2)In order to display a segmentation data in color I
 needed to modify the igstkImageSpatialObject but adding two methods:</DIV>  <DIV>void SetPseudoColorGray(){<BR>&nbsp; m_LUT-&gt;SetTableRange ( (m_Level - m_Window/2.0), (m_Level + m_Window/2.0) );<BR>&nbsp; m_LUT-&gt;SetSaturationRange (0.0, 0.0);<BR>&nbsp; m_LUT-&gt;SetHueRange (0.0, 0.0);<BR>&nbsp; m_LUT-&gt;SetValueRange (0.0, 1.0);<BR>&nbsp; m_LUT-&gt;SetRampToLinear();<BR>}</DIV>  <DIV>void saSetPseudoColorRedBlue(){<BR>&nbsp; m_LUT-&gt;SetValueRange (1, 1);<BR>&nbsp; m_LUT-&gt;SetSaturationRange (1, 1);<BR>&nbsp; m_LUT-&gt;SetHueRange (0.677, 1.0);<BR>&nbsp; m_LUT-&gt;SetNumberOfColors(256);<BR>&nbsp; m_LUT-&gt;SetTableRange (0.0,255.0 );<BR>&nbsp; m_LUT-&gt;Build(); <BR>&nbsp; m_LUT-&gt;SetTableValue(0, 0.0, 0.0, 0.0, 0.1);<BR>&nbsp; m_LUT-&gt;SetTableValue(1, 0.3, 1.0, 0.0, 0.5);<BR>&nbsp; m_LUT-&gt;SetTableValue(2, 1.0, 7.0, 0.5, 0.7);<BR>&nbsp; m_LUT-&gt;SetTableValue(3, 0.6, 0.3, 1.0, 0.7);<BR>&nbsp; m_LUT-&gt;SetTableValue(4, 0.5, 1.0, 0.5,
 0.2);<BR>}<BR></DIV>  <DIV>I call the first one after I create m_ImageRepresentationAxial1 for CT data and second one to color my tumor data in red(actualy my second data contains&nbsp;1 for tumor,2 for entrypoint area,3 for safety margin around tumor,4 for no touch zone&nbsp;)<BR>You presume by default that ImageSpatialobject should pseudocolor the data in gray scale.I think only CTImageSpatialobject&nbsp; should do that.</DIV>  <DIV>&nbsp;</DIV>  <DIV>3)If I want to display the tumor contour basically I&nbsp;preprocess the segmentation data with a surface extraction algorithm that does the following:for each voxel that has the value 1 for tumor check his neighbours if they are background then I keep that voxel otherwise I discard it.</DIV>  <DIV>&nbsp;</DIV>  <DIV>4)I read all my segmentation data from an "planning file" that has the next format:</DIV>  <DIV>#Number of entry points<BR>1<BR>#entry points<BR>114.674 64.9553 44.9074&nbsp;&nbsp; <BR>#ablation radius in
 mm<BR>40 <BR>#Number of ablations<BR>5&nbsp;&nbsp; <BR># x y z<BR>128.452 87.4343 35.4807<BR>135.341 98.6738 30.7674<BR>....</DIV>  <DIV>and also I read separately segmentation file which is a binary file that has 0 for background,1 for tumor,2 for entry point.</DIV>  <DIV>&nbsp;</DIV>  <DIV>Inside the code I rasterize the spheres and combine the information with the segmentation file.</DIV>  <DIV>I think probably an XML file that contains all this planning data with a special igstk reader that parses all this information will be more appropriate.</DIV>  <DIV>&nbsp;</DIV>  <DIV>In order to add&nbsp;these planning components&nbsp;to IGSK sandbox&nbsp;I&nbsp;have to&nbsp;write a basic XML Planning reader and an PlanningSpatialObject and PlanningSpatialObjectRepresentationAxial,PlanningSpatialObjectRepresentationSaggital,PlanningSpatialObjectRepresentation3D(this should display surfaces with transparency or by using&nbsp;raycasting).This PlanningSpatialObject should contain
 an 3D image that has different values for different components.</DIV>  <DIV>I'm not sure how this can help and if it fits Igstk paradigm.</DIV>  <DIV>&nbsp;</DIV>  <DIV>For my application I found that Igstk&nbsp;provides only a simple surgical planning(entry point and target point).</DIV>  <DIV>&nbsp;</DIV>  <DIV>Teo</DIV><BR><BR><B><I>Luis Ibanez &lt;luis.ibanez@kitware.com&gt;</I></B> wrote:  <BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid"><BR>Hi Ionut,<BR><BR><BR>Thanks for letting us know of your results.<BR>They look great.<BR><BR><BR>1) You could have indeed used the vtkCut filter<BR>and then follow it with the vtkDelaunay2D filter,<BR>in order to generate a triangulation of the contour.<BR>This will work fine as long as the contour is convex.<BR><BR><BR>2) I would encourage you to share this class with the<BR>community. We could rename it and put it in the<BR>IGSTK Sandbox. If you found this class useful, it
 is<BR>very likely that others will do so too. By sharing the<BR>code, you will also benefit from improvements that other<BR>may make to the class.<BR><BR><BR>3) RequestSetImage() in the ImageSpatialObject is declared<BR>private for safety reasons. The purpose is to ensure that<BR>*only* image readers can put an image in an ImageSpatialObject.<BR>That is, ImageReaders are the *only trusted* source of images.<BR><BR>Remember that the purpose of IGSTK is to provide image<BR>guidance during a surgery. We don't expect that you are<BR>going to do Image Segmentation in the middle of a surgery.<BR><BR>That will be overly optimistic, and border in irresponsible.<BR><BR>We anticipate that you will perform segmentation as part<BR>of *planning* the surgery. (e.g. days or at least hours,<BR>before the actual surgical intervention). You wil save<BR>those segmentations as images or as meshes, and at the<BR>time of the surgery you will only *read* those segmentation<BR>into the
 scene.<BR><BR><BR>Why is that your image is not being provided by a Reader ?<BR><BR><BR><BR>Please let us know,<BR><BR><BR>Thanks<BR><BR><BR>Luis<BR><BR><BR><BR>------------------------<BR>ionut iorgovan wrote:<BR>&gt; Hi Luis,<BR>&gt; <BR>&gt; I implemented this using my idea.The reason I didn't use vtkCut is I <BR>&gt; dont think I can use vtkCut to display tumors except as contours not as <BR>&gt; filled polygon.(Can I do that with vtkCut?)<BR>&gt; <BR>&gt; _http://isiswiki.georgetown.edu/teo/rfacolor.jpg_<BR>&gt; __ <BR>&gt; But I didn't implemented it as a separated <BR>&gt; igstkImageContourSpatialObjectRepresentation as you suggested , I just <BR>&gt; modified the igstkImageSpatialObjectRepresentation :(.(because only is <BR>&gt; for my own usage)<BR>&gt; <BR>&gt; My only concern is the RequestSetImage() method from <BR>&gt; igstkImageSpatialObject require that my application is a friend of that <BR>&gt; class.I dont understand why this method cannot be accessed
 directly ?<BR>&gt; <BR>&gt; Teo<BR>&gt; <BR>&gt; */Luis Ibanez <LUIS.IBANEZ@KITWARE.COM>/* wrote:<BR>&gt; <BR>&gt; <BR>&gt; Hi Teo,<BR>&gt; <BR>&gt; Implementing this functionality by redrawing an image<BR>&gt; is a bit of an overkill. You can do it in a simpler<BR>&gt; way by using creating a new image representation class<BR>&gt; and using a vtkContour + a vtkCut filter inside.<BR>&gt; <BR>&gt; <BR>&gt; 1) You can implement this functionality as a new type<BR>&gt; of ImageRepresentation class.<BR>&gt; <BR>&gt; 2) If you start from the current class:<BR>&gt; <BR>&gt; igstkImageSpatialObjectRepresentation.<BR>&gt; <BR>&gt; and create a new class, with (for example) name<BR>&gt; <BR>&gt; igstkImageContourSpatialObjectRepresentation.<BR>&gt; <BR>&gt; 3) Inside that new class you remove the<BR>&gt; <BR>&gt; vtkImageActor<BR>&gt; vtkLookupTable<BR>&gt; vtkImageMapToColors<BR>&gt; <BR>&gt; and replace them with a vtkContour filter and<BR>&gt; a normal vtkActor.<BR>&gt; <BR>&gt;
 <BR>&gt; 4) Then setup a similar pipeline to the one illustrated<BR>&gt; in the ITK example:<BR>&gt; <BR>&gt; InsightApplications/Auxiliary/vtk<BR>&gt; itkReadITKImage3DSegmentShowVTK.cxx<BR>&gt; <BR>&gt; 5) The image that you need to pass to the vtkContour filter<BR>&gt; is the vtkImageData that you get from the VTKImageObserver.<BR>&gt; <BR>&gt; <BR>&gt; <BR>&gt; The reason behind the apparently complicated way of passing<BR>&gt; images is that IGSTK does not expose ITK or VTK classes in<BR>&gt; order to increase the safety of the software applications.<BR>&gt; <BR>&gt; <BR>&gt; The igstkImage class contains internally an ITK image, and<BR>&gt; using an ITK export + VTK import filter, it reuses the pixel<BR>&gt; data in order to create a vtkImageData object that you can<BR>&gt; pass to a VTK pipeline.<BR>&gt; <BR>&gt; <BR>&gt; <BR>&gt; Please let us know if you find any difficulties implementing<BR>&gt; the igstkImageContourSpatialObjectRepresentation class.<BR>&gt;
 <BR>&gt; <BR>&gt; <BR>&gt; Thanks<BR>&gt; <BR>&gt; <BR>&gt; <BR>&gt; Luis<BR>&gt; <BR>&gt; <BR>&gt; <BR>&gt; <BR>&gt; ------------------------<BR>&gt; ionut iorgovan wrote:<BR>&gt; &gt; Hi,<BR>&gt; &gt;<BR>&gt; &gt; I want to display the contour of a segmented object in<BR>&gt; Axial,Sagittal<BR>&gt; &gt; and Coronal Views using igstk.<BR>&gt; &gt; I saw there are implemented in IGSTK sandbox some classes that start<BR>&gt; &gt; with Contour but they suport only mesh representation and also<BR>&gt; there is<BR>&gt; &gt; no documentation how to use them, and what goes were.<BR>&gt; &gt;<BR>&gt; &gt; Therefore I tried to implement my own classes.<BR>&gt; &gt; I wanted to display a second transparent slice(above the CT data)<BR>&gt; that<BR>&gt; &gt; shows a rasterized contour rather than a 3d object.<BR>&gt; &gt;<BR>&gt; &gt; So I wrote my own SpatialObject and SpatialObjectRepresentation.<BR>&gt; &gt; My workflow goes like this:<BR>&gt; &gt; 1.Create an empty 3D image(vtk
 or itk) that has the same<BR>&gt; dimension like<BR>&gt; &gt; CTSpatialObject internal image data.<BR>&gt; &gt; 2.Draw my countours inside this image<BR>&gt; &gt; 3.Pass the image to my SpatialObject in a similar fashion with<BR>&gt; &gt; CTImageSpatialObject.<BR>&gt; &gt;<BR>&gt; &gt; My problem is the RequestGetITKImage() with afferent event<BR>&gt; &gt; ITKImageModifiedEvent is not fully implemented so I<BR>&gt; &gt; used RequestGetVTKImage() instead and then get the<BR>&gt; dimensions,spacing<BR>&gt; &gt; from the vtk image and create a new itk image.<BR>&gt; &gt;<BR>&gt; &gt; My questions are<BR>&gt; &gt; 1.How can I display contours in igstk(the book offers no clue on<BR>&gt; how I<BR>&gt; &gt; can do this)?<BR>&gt; &gt; 2.Why the class has a RequestGetITKImage() and no event<BR>&gt; &gt; ITKImageModifiedEvent?<BR>&gt; &gt; 3.What is the reason behind this very complicated way of passing<BR>&gt; image<BR>&gt; &gt; data between classes?<BR>&gt; &gt; 4.Is isgtk keeping
 an internal copy of the 3d data in each class?<BR>&gt; &gt; 5.How a user is supposed to use correctly an Igstk<BR>&gt; &gt; component(methods,event,states-look in constructor for allowed<BR>&gt; requests,<BR>&gt; &gt; look for allowed events)?<BR>&gt; &gt;<BR>&gt; &gt; Teo<BR>&gt; &gt;<BR>&gt; &gt;<BR>&gt; ------------------------------------------------------------------------<BR>&gt; &gt; Luggage? GPS? Comic books?<BR>&gt; &gt; Check out fitting gifts for grads<BR>&gt; &gt;<BR>&gt; &gt; at Yahoo! Search.<BR>&gt; &gt;<BR>&gt; &gt;<BR>&gt; &gt;<BR>&gt; ------------------------------------------------------------------------<BR>&gt; &gt;<BR>&gt; &gt; _______________________________________________<BR>&gt; &gt; IGSTK-Users mailing list<BR>&gt; &gt; IGSTK-Users@public.kitware.com<BR>&gt; &gt; http://public.kitware.com/cgi-bin/mailman/listinfo/igstk-users<BR>&gt; <BR>&gt; <BR>&gt; ------------------------------------------------------------------------<BR>&gt; Get your own web
 address. <BR>&gt; <HTTP: evt="49678/*http://smallbusiness.yahoo.com/domains/?p=BESTDEAL" us.rd.yahoo.com><BR>&gt; Have a HUGE year through Yahoo! Small Business. &lt; <BR>&gt; http://us.rd.yahoo.com/evt=49678/*http://smallbusiness.yahoo.com/domains/?p=BESTDEAL&gt; <BR>&gt; <BR>&gt; <BR>&gt; <BR>&gt; ------------------------------------------------------------------------<BR>&gt; <BR>&gt; _______________________________________________<BR>&gt; IGSTK-Users mailing list<BR>&gt; IGSTK-Users@public.kitware.com<BR>&gt; http://public.kitware.com/cgi-bin/mailman/listinfo/igstk-users<BR></BLOCKQUOTE><BR><p>&#32;
      <hr size=1>Take the Internet to Go: Yahoo!Go puts the <a href="http://us.rd.yahoo.com/evt=48253/*http://mobile.yahoo.com/go?refer=1GNXIC">Internet in your pocket:</a> mail, news, photos & more.