Mercurial > hg > orthanc-stone
diff Framework/Toolbox/FiniteProjectiveCamera.cpp @ 735:c3bbb130abc4
removing dependencies in ImageBuffer3D
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 21 May 2019 16:15:06 +0200 |
parents | 9a474e90e832 |
children | ffec76a5f7eb |
line wrap: on
line diff
--- a/Framework/Toolbox/FiniteProjectiveCamera.cpp Tue May 21 15:20:04 2019 +0200 +++ b/Framework/Toolbox/FiniteProjectiveCamera.cpp Tue May 21 16:15:06 2019 +0200 @@ -23,6 +23,7 @@ #include "GeometryToolbox.h" #include "SubpixelReader.h" +#include "ParallelSlices.h" #include <Core/Logging.h> #include <Core/OrthancException.h> @@ -299,6 +300,7 @@ static void ApplyRaytracerInternal(Orthanc::ImageAccessor& target, const FiniteProjectiveCamera& camera, const ImageBuffer3D& source, + const VolumeImageGeometry& geometry, VolumeProjection projection) { if (source.GetFormat() != SourceFormat || @@ -315,8 +317,8 @@ LOG(WARNING) << "Output image size: " << target.GetWidth() << "x" << target.GetHeight(); LOG(WARNING) << "Output pixel format: " << Orthanc::EnumerationToString(target.GetFormat()); - std::auto_ptr<OrthancStone::ParallelSlices> slices(source.GetGeometry(projection)); - const OrthancStone::Vector pixelSpacing = source.GetGeometry().GetVoxelDimensions(projection); + std::auto_ptr<OrthancStone::ParallelSlices> slices(OrthancStone::ParallelSlices::FromVolumeImage(geometry, projection)); + const OrthancStone::Vector pixelSpacing = geometry.GetVoxelDimensions(projection); const unsigned int targetWidth = target.GetWidth(); const unsigned int targetHeight = target.GetHeight(); @@ -422,6 +424,7 @@ Orthanc::ImageAccessor* FiniteProjectiveCamera::ApplyRaytracer(const ImageBuffer3D& source, + const VolumeImageGeometry& geometry, Orthanc::PixelFormat targetFormat, unsigned int targetWidth, unsigned int targetHeight, @@ -440,14 +443,14 @@ { ApplyRaytracerInternal<Orthanc::PixelFormat_Grayscale16, Orthanc::PixelFormat_Grayscale16, true> - (*target, *this, source, projection); + (*target, *this, source, geometry, projection); } else if (targetFormat == Orthanc::PixelFormat_Grayscale16 && source.GetFormat() == Orthanc::PixelFormat_Grayscale16 && !mip) { ApplyRaytracerInternal<Orthanc::PixelFormat_Grayscale16, Orthanc::PixelFormat_Grayscale16, false> - (*target, *this, source, projection); + (*target, *this, source, geometry, projection); } else {