]> Creatis software - clitk.git/commitdiff
Handle panel shift in Backprojection
authorVivien Delmon <vivien.delmon@creatis.insa-lyon.fr>
Mon, 30 May 2011 11:54:45 +0000 (13:54 +0200)
committerVivien Delmon <vivien.delmon@creatis.insa-lyon.fr>
Mon, 30 May 2011 11:54:45 +0000 (13:54 +0200)
Handle panel shift in x and y direction to generate back projected
images.

itk/clitkBackProjectImageFilter.h
itk/clitkBackProjectImageFilter.txx

index ebaeffc49fee3ff2c3753d7d8a4d344e6b5c2cf5..7de71a116111326f2bed06060af31bc165a6ecb5 100644 (file)
@@ -148,6 +148,11 @@ namespace clitk
        }
     }
 
+    void SetPanelShift(double x, double y)
+    {
+      m_PanelShift[0] = x;
+      m_PanelShift[1] = y;
+    }
     //     itkSetMacro(IsoCenter, OutputPointType);
     //     itkGetConstReferenceMacro(IsoCenter, OutputPointType)
     //     itkSetMacro( SourceToScreen, double );
@@ -258,6 +263,7 @@ namespace clitk
     double  m_SourceToAxis;
     OutputPixelType m_EdgePaddingValue;
     double m_ProjectionAngle;
+    double m_PanelShift[2];
 
     // Output image info
     OutputSizeType                m_OutputSize;        // Size of the output image
index 0e30a9a1eacc306329d79461b2d70fe83db5c6b2..befc8822013cb8543d7bbc0d3ece59b417f84b31 100644 (file)
@@ -40,6 +40,8 @@ namespace clitk
     this->m_SourceToAxis = 1000.0;
     this->m_EdgePaddingValue = itk::NumericTraits<OutputPixelType>::Zero;//density images
     this->m_RigidTransformMatrix.SetIdentity();
+    this->m_PanelShift[0] = 0.;
+    this->m_PanelShift[1] = 0.;
 
     //Parameters for output
     this->m_OutputSpacing.Fill(1);
@@ -334,8 +336,8 @@ namespace clitk
        
     //Compute the first input coordinate (invert Y/X)
     homInputPoint= (m_ProjectionMatrix * homOutputPoint);
-    iPoint[0]=-homInputPoint[0]/homInputPoint[2];
-    iPoint[1]=homInputPoint[1]/homInputPoint[2];
+    iPoint[0]=-homInputPoint[0]/homInputPoint[2] + m_PanelShift[0];
+    iPoint[1]=homInputPoint[1]/homInputPoint[2] + m_PanelShift[1];
 
     typedef itk::LinearInterpolateImageFunction< InputImageType, double > InterpolatorType;
     typename InterpolatorType::Pointer interpolator = InterpolatorType::New();