Mercurial > hg > orthanc-stone
comparison OrthancStone/Sources/Loaders/DicomVolumeLoader.cpp @ 1640:52b8b96cb55f
cleaning namespaces
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 10 Nov 2020 16:55:22 +0100 |
parents | 8563ea5d8ae4 |
children | 9ac2a65d4172 |
comparison
equal
deleted
inserted
replaced
1639:5cdc5b98f14d | 1640:52b8b96cb55f |
---|---|
31 framesLoader_(framesLoader), | 31 framesLoader_(framesLoader), |
32 isValid_(false), | 32 isValid_(false), |
33 started_(false), | 33 started_(false), |
34 remaining_(0) | 34 remaining_(0) |
35 { | 35 { |
36 volume_.reset(new OrthancStone::DicomVolumeImage); | 36 volume_.reset(new DicomVolumeImage); |
37 | 37 |
38 const SeriesOrderedFrames& frames = framesLoader_->GetOrderedFrames(); | 38 const SeriesOrderedFrames& frames = framesLoader_->GetOrderedFrames(); |
39 | 39 |
40 if (frames.IsRegular3DVolume() && | 40 if (frames.IsRegular3DVolume() && |
41 frames.GetFramesCount() > 0) | 41 frames.GetFramesCount() > 0) |
42 { | 42 { |
43 // TODO - Is "0" the good choice for the reference frame? | 43 // TODO - Is "0" the good choice for the reference frame? |
44 // Shouldn't we use "count - 1" depending on the direction | 44 // Shouldn't we use "count - 1" depending on the direction |
45 // of the normal? | 45 // of the normal? |
46 const OrthancStone::DicomInstanceParameters& parameters = frames.GetInstanceParameters(0); | 46 const DicomInstanceParameters& parameters = frames.GetInstanceParameters(0); |
47 | 47 |
48 OrthancStone::CoordinateSystem3D plane(frames.GetInstance(0)); | 48 CoordinateSystem3D plane(frames.GetInstance(0)); |
49 | 49 |
50 OrthancStone::VolumeImageGeometry geometry; | 50 VolumeImageGeometry geometry; |
51 geometry.SetSizeInVoxels(parameters.GetImageInformation().GetWidth(), | 51 geometry.SetSizeInVoxels(parameters.GetImageInformation().GetWidth(), |
52 parameters.GetImageInformation().GetHeight(), | 52 parameters.GetImageInformation().GetHeight(), |
53 static_cast<unsigned int>(frames.GetFramesCount())); | 53 static_cast<unsigned int>(frames.GetFramesCount())); |
54 geometry.SetAxialGeometry(plane); | 54 geometry.SetAxialGeometry(plane); |
55 | 55 |
81 LOG(WARNING) << "Not a regular 3D volume"; | 81 LOG(WARNING) << "Not a regular 3D volume"; |
82 } | 82 } |
83 } | 83 } |
84 | 84 |
85 | 85 |
86 void DicomVolumeLoader::Handle(const OrthancStone::SeriesFramesLoader::FrameLoadedMessage& message) | 86 void DicomVolumeLoader::Handle(const SeriesFramesLoader::FrameLoadedMessage& message) |
87 { | 87 { |
88 if (remaining_ == 0 || | 88 if (remaining_ == 0 || |
89 !message.HasUserPayload()) | 89 !message.HasUserPayload()) |
90 { | 90 { |
91 throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError); | 91 throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError); |