]> Creatis software - clitk.git/commitdiff
fix composition order bug; add panel position. Panel position settings are still...
authorschaerer <schaerer>
Fri, 30 Jul 2010 13:38:59 +0000 (13:38 +0000)
committerschaerer <schaerer>
Fri, 30 Jul 2010 13:38:59 +0000 (13:38 +0000)
tools/clitkConeBeamProjectImage.ggo
tools/clitkConeBeamProjectImageFilter.h
tools/clitkConeBeamProjectImageFilter.txx
tools/clitkConeBeamProjectImageGenericFilter.cxx

index f6d381f7ac3a37f4132f40025fa081d76a18f1b4..945b96d4d52d469a5329c8cbfff0da930cd52d96 100755 (executable)
@@ -34,4 +34,4 @@ option "origin"                       -       "Origin for the output image"                   double          multiple no     default=
 option "size"                  -       "Size for the output image"                     int             multiple no     default="512"       
 option "spacing"               -       "Spacing for the output image"                  double          multiple no     default="0.8"       
 
-
+option "panel_position"         -       "Position of the panel: small, medium or large" string          no              default="small"
index 6ef578a63d94a0951e3bb3a24cf2fac3d44ed9a7..2269bd4d811c044d19d90b6ae9d9dd145f8ebbe0 100755 (executable)
@@ -187,6 +187,16 @@ namespace clitk
        }
     }
 
+    /** Set the panelshift. */
+    void SetPanelShift(double shift)
+    {
+      if (m_PanelShift!=shift)
+       {
+         m_PanelShift=shift;
+         m_IsInitialized=false;
+       }
+    }
+
     /** Helper method to set the output parameters based on this image */
     void SetOutputParametersFromImage( const OutputImagePointer image );
 
@@ -219,6 +229,7 @@ namespace clitk
     double m_SourceToScreen;
     double m_SourceToAxis;
     double m_ProjectionAngle;
+    double m_PanelShift;
     MatrixType m_RigidTransformMatrix;
     OutputPixelType m_EdgePaddingValue;
 
index 173411f5531be7b8bd2057beaaecfb5a5a9d407b..9a103e64cafa71c71481ed7741713fb111456cd7 100755 (executable)
@@ -114,7 +114,7 @@ namespace clitk
     itk::Matrix<double,4,4> centeredRotationMatrix = GetCenteredRotationMatrix3D(rotationParameters,transformedCenter);
     
     // Compose this rotation with the rigid transform matrix
-    itk::Matrix<double,4,4> finalTransform = centeredRotationMatrix * m_RigidTransformMatrix;
+    itk::Matrix<double,4,4> finalTransform = m_RigidTransformMatrix * centeredRotationMatrix ;
     
     // Set the rotation
     itk::Matrix<double,3,3> finalRotation = GetRotationalPartMatrix3D(finalTransform);
@@ -169,7 +169,7 @@ namespace clitk
     // JV -1 seems to correspond better with shearwarp of Simon Rit
     typename  InterpolatorType::InputPointType originOutput;
     originOutput[0] = m_IsoCenter[0]- (m_SourceToScreen - m_SourceToAxis);
-    originOutput[1] = m_IsoCenter[1]-static_cast<double>(sizeOuput[1]-1)*spacingOutput[1]/2.0;
+    originOutput[1] = m_IsoCenter[1]-static_cast<double>(sizeOuput[1]-1)*spacingOutput[1]/2.0 - m_PanelShift;
     originOutput[2] = m_IsoCenter[2]-static_cast<double>(sizeOuput[2]-1)*spacingOutput[2]/2.0; 
     m_Resampler->SetOutputOrigin( originOutput );
     if (m_Verbose)std::cout<<"The origin of the flat panel is at "<< originOutput <<",..."<< std::endl;
index 50d32a62763238487573a6a56615d4b422688fd0..fd983c6211904b10de895201c4af68d769022e50 100755 (executable)
@@ -131,6 +131,15 @@ namespace clitk
       }
     filter->SetEdgePaddingValue(static_cast<OutputPixelType>(m_ArgsInfo.pad_arg));
 
+    // Panel position (hard coded values for the elekta synergy)
+    // Two be more precise, one should read the specific values for each angle in Frame.dbf
+    if (strcmp(m_ArgsInfo.panel_position_arg,"small") !=0)
+      filter->SetPanelShift(0.);
+    else if (strcmp(m_ArgsInfo.panel_position_arg,"medium") !=0)
+      filter->SetPanelShift(114.84);
+    else if (strcmp(m_ArgsInfo.panel_position_arg,"large") !=0)
+      filter->SetPanelShift(190.);
+    else assert(false); //Unsupported panel position
     // Output image info
     if (m_ArgsInfo.like_given)
       {