<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>

<META content="MSHTML 5.00.2919.6307" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Hi,</FONT></DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp; I am trying to register two 3D data 
sets dataset1 and dataset2. After registering I </FONT></DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1) transform 
dataset2 using vtkImageReslice</FONT></DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2) blend the 
images using vtkImageBlend</FONT></DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 3) display the 
data using imageViewer.</FONT></DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 4) display the 
3D data of the blended image.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp; Now after scaling the size of dataset1 
and transformed dataset2 is not same. Hence when I blend the images, the images 
donot overlap. Instead the dataset2 starts from the lower left corner in the 
window. Using vtkReslice I tried to&nbsp;tried to bring the images in place, 
but&nbsp;this time&nbsp;I&nbsp;get the original image instead of the transformed 
one.Further a 3D view of the images is much worse. Can somebody please help me 
out. The pipeline is as follows :</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face="Courier New" size=2>
<P>void Reader::display() {</P>
<P>vtkTransform *transO1 = vtkTransform::New();</P>
<P>transO1-&gt;Translate(15,-5,0);</P>
<P>vtkTransform *transO2 = vtkTransform::New();</P>
<P>transO2-&gt;Translate(width/2,height/2,0);</P>
<P>vtkTransform *trans1 = vtkTransform::New();</P>
<P>trans1-&gt;Scale(0.9,0.9,1);</P>
<P>trans1-&gt;Translate(0,10,2); </P>
<P>vtkTransform *trans = vtkTransform::New();</P>
<P>trans-&gt;Concatenate(transform);</P>
<P></P>
<P>vtkVolume16Reader *reader1 = vtkVolume16Reader::New();</P>
<P>reader1-&gt;SetFilePrefix(fileName1[0]);</P>
<P>reader1-&gt;SetHeaderSize(header[0]);</P>
<P>if (byteSwap) </P>
<P>reader1-&gt;SwapBytesOn();</P>
<P>reader1-&gt;SetImageRange(range[0][0],range[0][1]);</P>
<P>reader1-&gt;SetDataSpacing(space[0][0], space[0][1], space[0][2]);</P>
<P>reader1-&gt;SetDataDimensions(height, width);</P>
<P>vtkImageReslice *reslice1 = vtkImageReslice::New();</P>
<P>reslice1-&gt;SetInput(reader1-&gt;GetOutput());</P>
<P>reslice1-&gt;InterpolateOn();</P>
<P>reslice1-&gt;SetInterpolationModeToCubic();</P>
<P>reslice1-&gt;OutputAlwaysCenteredOnInputOn() ;</P>
<P>vtkImageViewer *viewer1 = vtkImageViewer::New();</P>
<P>viewer1-&gt;SetInput(reslice1-&gt;GetOutput());</P>
<P>viewer1-&gt;SetColorLevel(1000);</P>
<P>viewer1-&gt;SetZSlice(0);</P>
<P>viewer1-&gt;Render();</P>
<P>reader1-&gt;Delete();</P>
<P>char a;</P>
<P>cin&gt;&gt;a;</P>
<P>vtkVolume16Reader *reader2 = vtkVolume16Reader::New();</P>
<P>reader2-&gt;SetFilePrefix(fileName1[1]);</P>
<P>reader2-&gt;SetHeaderSize(header[1]);</P>
<P>if (byteSwap) </P>
<P>reader2-&gt;SwapBytesOn();</P>
<P>reader2-&gt;SetImageRange(range[1][0],range[1][1]);</P>
<P>reader2-&gt;SetDataSpacing(space[1][0], space[1][1], space[1][2]);</P>
<P></P>
<P>reader2-&gt;SetDataDimensions(height, width);</P>
<P></P>
<P>reslice-&gt;SetInput(reader2-&gt;GetOutput());</P>
<P>reader2-&gt;Delete();</P>
<P>reslice-&gt;SetOutputSpacing(1,1,1);</P>
<P>reslice-&gt;InterpolateOn();</P>
<P>reslice-&gt;SetInterpolationModeToCubic();</P>
<P>reslice-&gt;OutputAlwaysCenteredOnInputOn() ;</P>
<P>reslice-&gt;SetResliceTransform(trans);</P>
<P></P>
<P>vtkImageTranslateExtent *extTrans = vtkImageTranslateExtent::New();</P>
<P>extTrans-&gt;SetInput(reslice-&gt;GetOutput());</P>
<P>extTrans-&gt;SetTranslation(width*0.0,height*0.0,0);</P>
<P></P>
<P>vtkImageReslice *reslice2 = vtkImageReslice::New();</P>
<P>reslice2-&gt;SetInput(extTrans-&gt;GetOutput());</P>
<P>vtkImageViewer *viewer2 = vtkImageViewer::New();</P>
<P>viewer2-&gt;SetInput(reslice-&gt;GetOutput());</P>
<P>viewer2-&gt;SetColorLevel(1000);</P>
<P>viewer2-&gt;SetZSlice(0);</P>
<P>viewer2-&gt;Render();</P>
<P>cin&gt;&gt;a;</P>
<P>vtkImageBlend *blend = vtkImageBlend::New();</P>
<P>blend-&gt;SetInput(0,reslice1-&gt;GetOutput());</P>
<P>blend-&gt;SetInput(1,reslice-&gt;GetOutput());</P>
<P>blend-&gt;SetOpacity(1,0.5);</P>
<P>vtkImageViewer *viewerB = vtkImageViewer::New();</P>
<P>viewerB-&gt;SetInput(blend-&gt;GetOutput());</P>
<P>viewerB-&gt;SetColorWindow(255.0);</P>
<P>viewerB-&gt;SetColorLevel(127.5);</P>
<P>viewerB-&gt;Render();</P>
<P>cin&gt;&gt;a;</P>
<P>vtkRenderWindow *win = vtkRenderWindow::New();</P>
<P>vtkRenderer *ren = vtkRenderer::New();</P>
<P>win-&gt;AddRenderer(ren);</P>
<P>vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor::New();</P>
<P>iren-&gt;SetRenderWindow(win);</P>
<P>vtkImageToStructuredPoints *iToStruct = 
vtkImageToStructuredPoints::New();</P>
<P>iToStruct-&gt;SetInput(blend-&gt;GetOutput());</P>
<P>vtkMarchingCubes *march = vtkMarchingCubes::New();</P>
<P>march-&gt;SetInput(iToStruct-&gt;GetOutput());</P>
<P>march-&gt;ComputeScalarsOff();</P>
<P>march-&gt;ComputeGradientsOff();</P>
<P>march-&gt;ComputeNormalsOff();</P>
<P>march-&gt;SetValue(0,150);</P>
<P></P>
<P>vtkSmoothPolyDataFilter *smoother = vtkSmoothPolyDataFilter::New();</P>
<P>smoother-&gt;SetInput(march-&gt;GetOutput());</P>
<P>smoother-&gt;SetNumberOfIterations(6);</P>
<P>smoother-&gt;SetRelaxationFactor(0.1);</P>
<P>smoother-&gt;SetFeatureAngle(10);</P>
<P>smoother-&gt;FeatureEdgeSmoothingOff();</P>
<P>smoother-&gt;BoundarySmoothingOff();</P>
<P>smoother-&gt;SetConvergence(0);</P>
<P>vtkPolyDataNormals *normals = vtkPolyDataNormals::New();</P>
<P>normals-&gt;SetInput(smoother-&gt;GetOutput());</P>
<P>normals-&gt;SetFeatureAngle(10);</P>
<P>vtkStripper *stripper = vtkStripper::New();</P>
<P>stripper-&gt;SetInput(normals-&gt;GetOutput());</P>
<P>vtkPolyDataMapper *mapper = vtkPolyDataMapper::New();</P>
<P>mapper-&gt;SetInput(stripper-&gt;GetOutput());</P>
<P>vtkActor *actor = vtkActor::New();</P>
<P>actor-&gt;SetMapper(mapper);</P>
<P>ren-&gt;AddActor(actor);</P>
<P>win-&gt;Render();</P>
<P>iren-&gt;Start();</P>
<P>}</P></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>AMIT</FONT>&nbsp;</DIV>
<DIV><FONT size=2>
<P>&nbsp;</P></FONT></DIV></BODY></HTML>