From 2a6a8d49224618d4bc2c132e83c0f4ba0268f17c Mon Sep 17 00:00:00 2001 From: Proton local user Date: Mon, 8 May 2023 17:54:16 +0200 Subject: [PATCH] Solved bug that would cause crash when trying to change parameters of regEngine with CT not yet loaded (example loading Scout LONG in DataView). Minor changes in UI functionalities to adjust for this new behaviour. Now loading of scouts is automatically followed by visualisation --- .../itkDTRrecon/itkImageProcessor.cpp | 30 +++++++++++++++---- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/reg23Topograms/itkDTRrecon/itkImageProcessor.cpp b/reg23Topograms/itkDTRrecon/itkImageProcessor.cpp index 17e53c8..c1c6b8c 100644 --- a/reg23Topograms/itkDTRrecon/itkImageProcessor.cpp +++ b/reg23Topograms/itkDTRrecon/itkImageProcessor.cpp @@ -694,13 +694,13 @@ int itkImageProcessor::fill3DVolumeMeta( } if(m_DRTImage2MetaInfo != NULL){ - std::cout << "NEVER HERE m_DRTImage2MetaInfo" << std::endl; - m_DRTImage2MetaInfo = NULL; + std::cout << "NEVER HERE m_DRTImage2MetaInfo" << std::endl; + m_DRTImage2MetaInfo = NULL; } if(m_RTMetaInfo != NULL){ - std::cout << "NEVER HERE m_RTMetaInfo" << std::endl; - m_RTMetaInfo = NULL; + std::cout << "NEVER HERE m_RTMetaInfo" << std::endl; + m_RTMetaInfo = NULL; } @@ -1122,7 +1122,6 @@ int itkImageProcessor::load2D(const char * pcFName){ //double* m_ImageIntensity; DuplicatorType::Pointer m_Duplicator; - bool* m_ImLoaded; TopogramImageMetaInformation::Pointer m_TImageMeta; switch (currProjOrientation) { @@ -1783,6 +1782,7 @@ void itkImageProcessor::InitializeProjector() m_DRTImage2MetaInfo == NULL || m_DRTGeometryMetaInfo == NULL || m_TransformMetaInfo == NULL ){ + return; //TODO } @@ -2076,18 +2076,22 @@ void itkImageProcessor::loadRTPlanInfo( void itkImageProcessor::UpdateProjectionGeometryMeta(){ if(m_CTMetaInfo == NULL){ + return; //TODO. } if(m_DRTGeometryMetaInfo == NULL){ + return; //TODO. } if(m_DRTImage1MetaInfo == NULL){ + return; //TODO. } if(m_DRTImage2MetaInfo == NULL){ + return; //TODO. } @@ -2325,6 +2329,7 @@ void itkImageProcessor::GetProjectionImages(){ m_DRTImage2MetaInfo == NULL || m_DRTGeometryMetaInfo == NULL || m_TransformMetaInfo == NULL ){ + return; //TODO } @@ -2697,6 +2702,14 @@ vtkImageData* itkImageProcessor::GetLocalizer2VTK() vtkImageData* itkImageProcessor::GetProjection1VTK() { + + if(m_DRTImage1MetaInfo == NULL || + m_DRTGeometryMetaInfo == NULL || + m_TransformMetaInfo == NULL ){ + return NULL; + //TODO + } + // Rescale the intensity of the projection images to 0-32768 for output. using RescaleFilterType = itk::RescaleIntensityImageFilter; @@ -2826,6 +2839,13 @@ vtkMatrix4x4 * itkImageProcessor::GetProjection2VTKTransform() vtkImageData* itkImageProcessor::GetProjection2VTK() { + if(m_DRTImage2MetaInfo == NULL || + m_DRTGeometryMetaInfo == NULL || + m_TransformMetaInfo == NULL ){ + return NULL; + //TODO + } + // Rescale the intensity of the projection images to 0-32768 for output. using RescaleFilterType = itk::RescaleIntensityImageFilter;