Hi david,<br><br>This 2 reslicer trick is what I needed!<br><br>Thanks a ton! You rock!<br><br>Pankaj<br><br><div><span class="gmail_quote">On 10/30/06, <b class="gmail_sendername">David Gobbi</b> &lt;<a href="mailto:dgobbi@atamai.com">
dgobbi@atamai.com</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Pankaj Daga wrote:<br>&gt; Hi David,<br>&gt;<br>&gt; Thanks for the tip! However, I am not using AutoCropOutput() and all
<br>&gt; that as it never worked how I intended.<br><br>Yeah, that method is not one of my favorites. Not everyone wants their<br>images to be cropped the same way, so the only way &quot;AutoCrop&quot; could be<br>really automatic is if it could read minds.&nbsp;&nbsp;The method does work as the
<br>documentation describes, though.<br><br>&gt; I mean, I could set the output extent etc. by hand again, but the<br>&gt; output of the reslicer is attached to a viewer and that would cause<br>&gt; the viewer to also change its output.
<br>&gt;<br>&gt; So, I was thinking that I could just resample the image again and that<br>&gt; should take care of everything.<br><br>Oh, that explains things.&nbsp;&nbsp;If you need two reslicers, here is what you<br>can for the second one:
<br><br>reslice2 = vtkImageReslice::New();<br>reslice2-&gt;SetInput(reslice1-&gt;GetOutput());<br>reslice2-&gt;SetInformationInput(reslice1-&gt;GetInput());<br>reslice2-&gt;TransformInputSamplingOff();<br>reslice2-&gt;SetInterpolationModeToLinear();
<br><br>The combination of SetInformationInput() to set the original image, and<br>TransformInputSamplingOff(), will cause vtkImageReslice to produce an<br>image with the same extent, spacing, and origin as the original image,
<br>if this is what you want.<br><br>If this isn't what you want, you might have to manually set the<br>OutputExtent(), OutputSpacing(), and OutputOrigin().&nbsp;&nbsp;One of the best<br>ways to do this is to add an observer for ExecuteInformationEvent to the
<br>reslicer.&nbsp;&nbsp;That way, you can add a callback that will adjust the<br>information every time that reslice executes.<br><br> - David<br><br>&gt;<br>&gt; Best regards,<br>&gt;<br>&gt; Pankaj<br>&gt;<br>&gt; On 10/30/06, * David Gobbi* &lt;
<a href="mailto:dgobbi@atamai.com">dgobbi@atamai.com</a><br>&gt; &lt;mailto:<a href="mailto:dgobbi@atamai.com">dgobbi@atamai.com</a>&gt;&gt; wrote:<br>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; Hi Pankaj,<br>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; I think that what you want is this:
<br>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; reslice-&gt;TransformInputSamplingOff();<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; reslice-&gt;AutoCropOutputOff();<br>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; That should cause vtkImageReslice to automatically produce an output<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; with the same spacing, origin, and dimensions as the input, so
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; that you<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; will not have to re-resample the output.<br>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; - David<br>&gt;<br>&gt;<br>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; Pankaj Daga wrote:<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt; Hi everyone,<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt; I do some oeprations on an image and then I need to save a resulting
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt; image. Now to generate the resulting image, I use the output from<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt; vtkImageReslice which has changed the image dimensions according to<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt; the output spacing and output extent parameters. However, I want to
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt; save the resulting image with the same size as the input image.<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt; Does anyone know what is the best way to resample the output<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; image and<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt; convert it to the same image dimensions as the input image? Some
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; code<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt; snippet would be really appreciated.<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt; Best wishes,<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt; P<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; ------------------------------------------------------------------------
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt; _______________________________________________<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt; This is the private VTK discussion list.<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt; Please keep messages on-topic. Check the FAQ at:<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; <a href="http://www.vtk.org/Wiki/VTK_FAQ">
http://www.vtk.org/Wiki/VTK_FAQ</a><br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt; Follow this link to subscribe/unsubscribe:<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt; <a href="http://www.vtk.org/mailman/listinfo/vtkusers">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt;
<br>&gt;<br>&gt;<br><br></blockquote></div><br>