Mercurial > hg > orthanc-stone
comparison Framework/Deprecated/Toolbox/DicomFrameConverter.cpp @ 1308:adf234ecaa00 broker
Merge
author | Benjamin Golinvaux <bgo@osimis.io> |
---|---|
date | Wed, 04 Mar 2020 10:21:54 +0100 |
parents | 8a0a62189f46 |
children | 30deba7bc8e2 |
comparison
equal
deleted
inserted
replaced
1307:8a28a9bf8876 | 1308:adf234ecaa00 |
---|---|
172 | 172 |
173 ReadParameters(converted); | 173 ReadParameters(converted); |
174 } | 174 } |
175 | 175 |
176 | 176 |
177 void DicomFrameConverter::ConvertFrameInplace(std::auto_ptr<Orthanc::ImageAccessor>& source) const | 177 void DicomFrameConverter::ConvertFrameInplace(std::unique_ptr<Orthanc::ImageAccessor>& source) const |
178 { | 178 { |
179 assert(sizeof(float) == 4); | 179 assert(sizeof(float) == 4); |
180 | 180 |
181 if (source.get() == NULL) | 181 if (source.get() == NULL) |
182 { | 182 { |
208 } | 208 } |
209 | 209 |
210 if (sourceFormat == Orthanc::PixelFormat_RGB24) | 210 if (sourceFormat == Orthanc::PixelFormat_RGB24) |
211 { | 211 { |
212 // This is the case of a color image. No conversion has to be done (*) | 212 // This is the case of a color image. No conversion has to be done (*) |
213 std::auto_ptr<Orthanc::Image> converted(new Orthanc::Image(Orthanc::PixelFormat_RGB24, | 213 std::unique_ptr<Orthanc::Image> converted(new Orthanc::Image(Orthanc::PixelFormat_RGB24, |
214 source.GetWidth(), | 214 source.GetWidth(), |
215 source.GetHeight(), | 215 source.GetHeight(), |
216 false)); | 216 false)); |
217 Orthanc::ImageProcessing::Copy(*converted, source); | 217 Orthanc::ImageProcessing::Copy(*converted, source); |
218 return converted.release(); | 218 return converted.release(); |
222 assert(sourceFormat == Orthanc::PixelFormat_Grayscale16 || | 222 assert(sourceFormat == Orthanc::PixelFormat_Grayscale16 || |
223 sourceFormat == Orthanc::PixelFormat_Grayscale32 || | 223 sourceFormat == Orthanc::PixelFormat_Grayscale32 || |
224 sourceFormat == Orthanc::PixelFormat_SignedGrayscale16); | 224 sourceFormat == Orthanc::PixelFormat_SignedGrayscale16); |
225 | 225 |
226 // This is the case of a grayscale frame. Convert it to Float32. | 226 // This is the case of a grayscale frame. Convert it to Float32. |
227 std::auto_ptr<Orthanc::Image> converted(new Orthanc::Image(Orthanc::PixelFormat_Float32, | 227 std::unique_ptr<Orthanc::Image> converted(new Orthanc::Image(Orthanc::PixelFormat_Float32, |
228 source.GetWidth(), | 228 source.GetWidth(), |
229 source.GetHeight(), | 229 source.GetHeight(), |
230 false)); | 230 false)); |
231 Orthanc::ImageProcessing::Convert(*converted, source); | 231 Orthanc::ImageProcessing::Convert(*converted, source); |
232 | 232 |