comparison Framework/Volumes/DicomVolumeImageMPRSlicer.cpp @ 1297:6ab03e429f06 broker

integration mainline->broker
author Sebastien Jodogne <s.jodogne@gmail.com>
date Sun, 23 Feb 2020 15:32:24 +0100
parents 7ec8fea061b9 f037422f3a66
children c38c89684d83
comparison
equal deleted inserted replaced
1281:68579a31eeb4 1297:6ab03e429f06
20 20
21 21
22 #include "DicomVolumeImageMPRSlicer.h" 22 #include "DicomVolumeImageMPRSlicer.h"
23 23
24 #include "../StoneException.h" 24 #include "../StoneException.h"
25
26 #include "../Toolbox/ImageToolbox.h"
25 27
26 #include <Core/OrthancException.h> 28 #include <Core/OrthancException.h>
27 //#include <Core/Images/PngWriter.h> 29 //#include <Core/Images/PngWriter.h>
28 #include <Core/Images/JpegWriter.h> 30 #include <Core/Images/JpegWriter.h>
29 31
77 std::auto_ptr<TextureBaseSceneLayer> texture; 79 std::auto_ptr<TextureBaseSceneLayer> texture;
78 80
79 { 81 {
80 const DicomInstanceParameters& parameters = volume_.GetDicomParameters(); 82 const DicomInstanceParameters& parameters = volume_.GetDicomParameters();
81 ImageBuffer3D::SliceReader reader(volume_.GetPixelData(), projection_, sliceIndex_); 83 ImageBuffer3D::SliceReader reader(volume_.GetPixelData(), projection_, sliceIndex_);
84
82 texture.reset(dynamic_cast<TextureBaseSceneLayer*> 85 texture.reset(dynamic_cast<TextureBaseSceneLayer*>
83 (configurator->CreateTextureFromDicom(reader.GetAccessor(), parameters))); 86 (configurator->CreateTextureFromDicom(reader.GetAccessor(), parameters)));
84 } 87 }
85 88
86 const CoordinateSystem3D& system = volume_.GetGeometry().GetProjectionGeometry(projection_); 89 const CoordinateSystem3D& system = volume_.GetGeometry().GetProjectionGeometry(projection_);
100 if (!LinearAlgebra::IsCloseToZero(dx) || 103 if (!LinearAlgebra::IsCloseToZero(dx) ||
101 !LinearAlgebra::IsCloseToZero(dy)) 104 !LinearAlgebra::IsCloseToZero(dy))
102 { 105 {
103 texture->SetAngle(atan2(dy, dx)); 106 texture->SetAngle(atan2(dy, dx));
104 } 107 }
105 108
106 Vector tmp = volume_.GetGeometry().GetVoxelDimensions(projection_); 109 Vector tmp = volume_.GetGeometry().GetVoxelDimensions(projection_);
107 texture->SetPixelSpacing(tmp[0], tmp[1]); 110 texture->SetPixelSpacing(tmp[0], tmp[1]);
108 111
109 return texture.release(); 112 return texture.release();
110 } 113 }