Mercurial > hg > orthanc-stone
comparison Framework/Volumes/VolumeImageGeometry.cpp @ 809:e8fdf29cd0ca
VolumeImageGeometry::GetProjectionSlice()
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 28 May 2019 18:09:26 +0200 |
parents | fa5febe0f0c2 |
children | ffec76a5f7eb |
comparison
equal
deleted
inserted
replaced
807:c237e0625065 | 809:e8fdf29cd0ca |
---|---|
304 { | 304 { |
305 slice = d; | 305 slice = d; |
306 return true; | 306 return true; |
307 } | 307 } |
308 } | 308 } |
309 | |
310 | |
311 CoordinateSystem3D VolumeImageGeometry::GetProjectionSlice(VolumeProjection projection, | |
312 unsigned int depth) const | |
313 { | |
314 if (depth >= GetProjectionDepth(projection)) | |
315 { | |
316 throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange); | |
317 } | |
318 | |
319 Vector dim = GetVoxelDimensions(projection); | |
320 CoordinateSystem3D plane = GetProjectionGeometry(projection); | |
321 | |
322 plane.SetOrigin(plane.GetOrigin() + static_cast<double>(depth) * plane.GetNormal() * dim[2]); | |
323 | |
324 return plane; | |
325 } | |
309 } | 326 } |