diff --git a/reg23Topograms/itkDTRrecon/DRTMetaInformation.cpp b/reg23Topograms/itkDTRrecon/DRTMetaInformation.cpp index 8368cc7..d1943e4 100644 --- a/reg23Topograms/itkDTRrecon/DRTMetaInformation.cpp +++ b/reg23Topograms/itkDTRrecon/DRTMetaInformation.cpp @@ -36,7 +36,7 @@ void TopogramImageMetaInformation ::PrintSelf(std::ostream& os, itk::Indent indent) const { - Superclass::PrintSelf(os, indent); + Superclass::PrintSelf(os, indent); } @@ -53,21 +53,21 @@ SetPatientOrientation(tPatOrientation m_orient) this->m_PatientOrientation = m_orient; for(int iIdx = 0 ; iIdx < 3; iIdx++){ - for(int jIdx = 0 ; jIdx < 3; jIdx++){ + for(int jIdx = 0 ; jIdx < 3; jIdx++){ - switch (this->m_PatientOrientation) { - case tPatOrientation::HFS: - m_LPS2IECDirections.GetVnlMatrix()[iIdx][jIdx] = HFS2IEC[jIdx+iIdx*3]; - break; - case tPatOrientation ::FFS: - m_LPS2IECDirections.GetVnlMatrix()[iIdx][jIdx] = FFS2IEC[jIdx+iIdx*3]; - break; - default: - m_LPS2IECDirections.SetIdentity(); - break; - } + switch (this->m_PatientOrientation) { + case tPatOrientation::HFS: + m_LPS2IECDirections.GetVnlMatrix()[iIdx][jIdx] = HFS2IEC[jIdx+iIdx*3]; + break; + case tPatOrientation ::FFS: + m_LPS2IECDirections.GetVnlMatrix()[iIdx][jIdx] = FFS2IEC[jIdx+iIdx*3]; + break; + default: + m_LPS2IECDirections.SetIdentity(); + break; } } + } } @@ -100,7 +100,7 @@ void DRTImageMetaInformation ::PrintSelf(std::ostream& os, itk::Indent indent) const { - Superclass::PrintSelf(os, indent); + Superclass::PrintSelf(os, indent); } @@ -182,24 +182,20 @@ void DRTImageMetaInformation::SetSizeWithBounds( dPixMaxOverlap =dNPixMin1; if(dPixMaxOverlap > dNPixMax1){ - dPixMaxOverlap = dNPixMax1; - } + dPixMaxOverlap = dNPixMax1; + } + if(floor(dPixMaxOverlap*2) > MaxSize[1]) { - m_Size[1] = MaxSize[1]; - } else { - m_Size[1] = floor(dPixMaxOverlap*2); - } + m_Size[1] = MaxSize[1]; + } else { + m_Size[1] = floor(dPixMaxOverlap*2); + } m_Size[2] = 1; m_Spacing = Spacing; - - - return; - - - + return; } @@ -263,9 +259,9 @@ CTVolumeImageMetaInformation::GetProjectionOriginLPS( PointType ProjectionCenter) { -// PointType Origin; -// Origin = this->m_OriginLPS; -// Origin = Origin - this->m_ImportOffset; + // PointType Origin; + // Origin = this->m_OriginLPS; + // Origin = Origin - this->m_ImportOffset; DirectionType IECtoLPS_Directions; IECtoLPS_Directions = this->m_LPS2IECDirections.GetTranspose(); @@ -279,8 +275,8 @@ CTVolumeImageMetaInformation::GetProjectionOriginLPS( * middle of the volume */ m_ProjectionOriginLPS[2] = this->GetCOV()[2] - this->m_ImportOffset[2]; - return - m_ProjectionOriginLPS; + return + m_ProjectionOriginLPS; } @@ -305,8 +301,8 @@ CTVolumeImageMetaInformation::GetProjectionOriginLPSZero( m_ProjectionOriginLPS[2] = this->GetCOV()[2] - this->m_ImportOffset[2]; - return - m_ProjectionOriginLPS - Origin; + return + m_ProjectionOriginLPS - Origin; } @@ -315,29 +311,29 @@ CTVolumeImageMetaInformation::CalculateRegions(PointType pProjectionOriginLPS) { /* calculate image size in 3D Space by finding the last voxel position */ - PointType Dest; - Dest[0]=(m_Size[0]-1) * m_Spacing [0]; - Dest[1]=(m_Size[1]-1) * m_Spacing [1]; - Dest[2]=(m_Size[2]-1) * m_Spacing [2]; + PointType Dest; + Dest[0]=(m_Size[0]-1) * m_Spacing [0]; + Dest[1]=(m_Size[1]-1) * m_Spacing [1]; + Dest[2]=(m_Size[2]-1) * m_Spacing [2]; - PointType LastVoxelPosition = - (m_ImageDirections * Dest); + PointType LastVoxelPosition = + (m_ImageDirections * Dest); - LastVoxelPosition [0] += m_OriginLPS[0]; - LastVoxelPosition [1] += m_OriginLPS[1]; - LastVoxelPosition [2] += m_OriginLPS[2]; + LastVoxelPosition [0] += m_OriginLPS[0]; + LastVoxelPosition [1] += m_OriginLPS[1]; + LastVoxelPosition [2] += m_OriginLPS[2]; - std::vector vBounds; - vBounds.clear(); - vBounds.push_back( pProjectionOriginLPS[0] - LastVoxelPosition [0] ); - vBounds.push_back( pProjectionOriginLPS[1] - LastVoxelPosition [1] ); - vBounds.push_back( pProjectionOriginLPS[2] - LastVoxelPosition [2] ); - vBounds.push_back( pProjectionOriginLPS[0] - m_OriginLPS [0] ); - vBounds.push_back( pProjectionOriginLPS[1] - m_OriginLPS [1] ); - vBounds.push_back( pProjectionOriginLPS[2] - m_OriginLPS [2] ); + std::vector vBounds; + vBounds.clear(); + vBounds.push_back( pProjectionOriginLPS[0] - LastVoxelPosition [0] ); + vBounds.push_back( pProjectionOriginLPS[1] - LastVoxelPosition [1] ); + vBounds.push_back( pProjectionOriginLPS[2] - LastVoxelPosition [2] ); + vBounds.push_back( pProjectionOriginLPS[0] - m_OriginLPS [0] ); + vBounds.push_back( pProjectionOriginLPS[1] - m_OriginLPS [1] ); + vBounds.push_back( pProjectionOriginLPS[2] - m_OriginLPS [2] ); - return - vBounds; + return + vBounds; } @@ -365,7 +361,7 @@ void CTVolumeImageMetaInformation ::PrintSelf(std::ostream& os, itk::Indent indent) const { - Superclass::PrintSelf(os, indent); + Superclass::PrintSelf(os, indent); } @@ -381,21 +377,21 @@ SetPatientOrientation(tPatOrientation m_orient) this->m_PatientOrientation = m_orient; for(int iIdx = 0 ; iIdx < 3; iIdx++){ - for(int jIdx = 0 ; jIdx < 3; jIdx++){ + for(int jIdx = 0 ; jIdx < 3; jIdx++){ - switch (this->m_PatientOrientation) { - case tPatOrientation::HFS: - m_LPS2IECDirections.GetVnlMatrix()[iIdx][jIdx] = HFS2IEC[jIdx+iIdx*3]; - break; - case tPatOrientation ::FFS: - m_LPS2IECDirections.GetVnlMatrix()[iIdx][jIdx] = FFS2IEC[jIdx+iIdx*3]; - break; - default: - m_LPS2IECDirections.SetIdentity(); - break; - } + switch (this->m_PatientOrientation) { + case tPatOrientation::HFS: + m_LPS2IECDirections.GetVnlMatrix()[iIdx][jIdx] = HFS2IEC[jIdx+iIdx*3]; + break; + case tPatOrientation ::FFS: + m_LPS2IECDirections.GetVnlMatrix()[iIdx][jIdx] = FFS2IEC[jIdx+iIdx*3]; + break; + default: + m_LPS2IECDirections.SetIdentity(); + break; } } + } } @@ -478,7 +474,7 @@ void DRTProjectionGeometryImageMetaInformation ::PrintSelf(std::ostream& os, itk::Indent indent) const { - Superclass::PrintSelf(os, indent); + Superclass::PrintSelf(os, indent); } @@ -505,7 +501,7 @@ void RTGeometryMetaInformation ::PrintSelf(std::ostream& os, itk::Indent indent) const { - Superclass::PrintSelf(os, indent); + Superclass::PrintSelf(os, indent); } @@ -521,17 +517,17 @@ RTGeometryMetaInformation TransformMetaInformation :: TransformMetaInformation (){ - m_Translations.Fill(0.); + m_Translations.Fill(0.); - m_Rotations.Fill(0.); + m_Rotations.Fill(0.); - m_UserRotations.Fill(0.); + m_UserRotations.Fill(0.); - m_UserTranslations.Fill(0.); + m_UserTranslations.Fill(0.); - m_ReferenceTransform.Fill(0.); + m_ReferenceTransform.Fill(0.); - m_CurrentTransform.Fill(0.); + m_CurrentTransform.Fill(0.); } @@ -539,7 +535,7 @@ void TransformMetaInformation ::PrintSelf(std::ostream& os, itk::Indent indent) const { - Superclass::PrintSelf(os, indent); + Superclass::PrintSelf(os, indent); } diff --git a/reg23Topograms/itkDTRrecon/itkImageProcessor.cpp b/reg23Topograms/itkDTRrecon/itkImageProcessor.cpp index 39c1673..19af153 100644 --- a/reg23Topograms/itkDTRrecon/itkImageProcessor.cpp +++ b/reg23Topograms/itkDTRrecon/itkImageProcessor.cpp @@ -1692,16 +1692,17 @@ void itkImageProcessor::UpdateProjectionGeometryMeta(){ // This is based on the calibrated iso to be sure... std::vector vBounds = m_CTMetaInfo->CalculateRegions( - NominalIsocenter_wZcorrectionLPS//m_DRTImage1MetaInfo->GetProjectionOriginLPS() + NominalIsocenter_wZcorrectionLPS +// m_DRTImage1MetaInfo->GetProjectionOriginLPS() ); -// std::cout<<"Bounds1: " -// <SetSizeWithBounds( vBounds.data(), @@ -1735,16 +1736,16 @@ void itkImageProcessor::UpdateProjectionGeometryMeta(){ Std_DRT2LPS) ); -// std::cout<<"IsocenterOffsetLPS"<< IsocenterOffsetLPS <GetSize()"<< m_DRTImage1MetaInfo->GetSize() <GetSpacing()"<< m_DRTImage1MetaInfo->GetSpacing() <GetOrigin()"<< m_DRTImage1MetaInfo->GetOrigin() <GetCOV()"<< m_DRTImage1MetaInfo->GetCOV() <GetOriginLPS()"<< m_DRTImage1MetaInfo->GetOriginLPS() <GetProjectionAngleLPS()"<GetProjectionAngleLPS()<GetImageDirectionsLPS()"<< m_DRTImage1MetaInfo->GetImageDirectionsLPS() <GetSize()"<< m_DRTImage1MetaInfo->GetSize() <GetSpacing()"<< m_DRTImage1MetaInfo->GetSpacing() <GetOrigin()"<< m_DRTImage1MetaInfo->GetOrigin() <GetCOV()"<< m_DRTImage1MetaInfo->GetCOV() <GetOriginLPS()"<< m_DRTImage1MetaInfo->GetOriginLPS() <GetProjectionAngleLPS()"<GetProjectionAngleLPS()<GetImageDirectionsLPS()"<< m_DRTImage1MetaInfo->GetImageDirectionsLPS() <GetProjectionOriginLPS() ); -// std::cout<<"Bounds2: " -// <SetSizeWithBounds( vBounds.data(), @@ -1823,16 +1824,16 @@ void itkImageProcessor::UpdateProjectionGeometryMeta(){ Std_DRT2LPS) ); -// std::cout<<"IsocenterOffsetLPS"<< IsocenterOffsetLPS <GetSize()"<< m_DRTImage2MetaInfo->GetSize() <GetSpacing()"<< m_DRTImage2MetaInfo->GetSpacing() <GetOrigin()"<< m_DRTImage2MetaInfo->GetOrigin() <GetCOV()"<< m_DRTImage2MetaInfo->GetCOV() <GetOriginLPS()"<< m_DRTImage2MetaInfo->GetOriginLPS() <GetProjectionAngleLPS()"<GetProjectionAngleLPS()<GetImageDirectionsLPS()"<< m_DRTImage2MetaInfo->GetImageDirectionsLPS() <GetSize()"<< m_DRTImage2MetaInfo->GetSize() <GetSpacing()"<< m_DRTImage2MetaInfo->GetSpacing() <GetOrigin()"<< m_DRTImage2MetaInfo->GetOrigin() <GetCOV()"<< m_DRTImage2MetaInfo->GetCOV() <GetOriginLPS()"<< m_DRTImage2MetaInfo->GetOriginLPS() <GetProjectionAngleLPS()"<GetProjectionAngleLPS()<GetImageDirectionsLPS()"<< m_DRTImage2MetaInfo->GetImageDirectionsLPS() <