Mercurial > hg > orthanc-stone
comparison Framework/Loaders/OrthancSeriesVolumeProgressiveLoader.cpp @ 1156:34ee7204fde3 broker
removing IGeometryProvider
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Sat, 16 Nov 2019 14:37:33 +0100 |
parents | a0a33e5ea5bb |
children |
comparison
equal
deleted
inserted
replaced
1155:e265ed3f7843 | 1156:34ee7204fde3 |
---|---|
183 slices_.push_back(new DicomInstanceParameters(slice)); | 183 slices_.push_back(new DicomInstanceParameters(slice)); |
184 } | 184 } |
185 | 185 |
186 CheckVolume(); | 186 CheckVolume(); |
187 | 187 |
188 const double spacingZ = slices.ComputeSpacingBetweenSlices(); | 188 double spacingZ; |
189 LOG(INFO) << "Computed spacing between slices: " << spacingZ << "mm"; | 189 |
190 | 190 if (slices.ComputeSpacingBetweenSlices(spacingZ)) |
191 const DicomInstanceParameters& parameters = *slices_[0]; | 191 { |
192 | 192 LOG(INFO) << "Computed spacing between slices: " << spacingZ << "mm"; |
193 geometry_.reset(new VolumeImageGeometry); | 193 |
194 geometry_->SetSizeInVoxels(parameters.GetImageInformation().GetWidth(), | 194 const DicomInstanceParameters& parameters = *slices_[0]; |
195 parameters.GetImageInformation().GetHeight(), | 195 |
196 static_cast<unsigned int>(slices.GetSlicesCount())); | 196 geometry_.reset(new VolumeImageGeometry); |
197 geometry_->SetAxialGeometry(slices.GetSliceGeometry(0)); | 197 geometry_->SetSizeInVoxels(parameters.GetImageInformation().GetWidth(), |
198 geometry_->SetVoxelDimensions(parameters.GetPixelSpacingX(), | 198 parameters.GetImageInformation().GetHeight(), |
199 parameters.GetPixelSpacingY(), spacingZ); | 199 static_cast<unsigned int>(slices.GetSlicesCount())); |
200 geometry_->SetAxialGeometry(slices.GetSliceGeometry(0)); | |
201 geometry_->SetVoxelDimensions(parameters.GetPixelSpacingX(), | |
202 parameters.GetPixelSpacingY(), spacingZ); | |
203 } | |
204 else | |
205 { | |
206 throw Orthanc::OrthancException(Orthanc::ErrorCode_BadGeometry, | |
207 "The origins of the slices of a volume image are not regularly spaced"); | |
208 } | |
200 } | 209 } |
201 } | 210 } |
202 | 211 |
203 | 212 |
204 const VolumeImageGeometry& OrthancSeriesVolumeProgressiveLoader::SeriesGeometry::GetImageGeometry() const | 213 const VolumeImageGeometry& OrthancSeriesVolumeProgressiveLoader::SeriesGeometry::GetImageGeometry() const |