comparison OrthancStone/Sources/Scene2D/LookupTableTextureSceneLayer.cpp @ 1919:ed4831e08961

added DicomInstanceParameters::CreateOverlayTexture()
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 21 Mar 2022 15:50:29 +0100
parents f81cdf283859
children 07964689cb0b
comparison
equal deleted inserted replaced
1918:fc6009c43bd9 1919:ed4831e08961
31 namespace OrthancStone 31 namespace OrthancStone
32 { 32 {
33 LookupTableTextureSceneLayer::LookupTableTextureSceneLayer(const Orthanc::ImageAccessor& texture) : 33 LookupTableTextureSceneLayer::LookupTableTextureSceneLayer(const Orthanc::ImageAccessor& texture) :
34 applyLog_(false) 34 applyLog_(false)
35 { 35 {
36 if (texture.GetFormat() == Orthanc::PixelFormat_Float32)
37 {
38 SetTexture(Orthanc::Image::Clone(texture));
39 }
40 else
36 { 41 {
37 std::unique_ptr<Orthanc::ImageAccessor> t( 42 std::unique_ptr<Orthanc::ImageAccessor> t(
38 new Orthanc::Image(Orthanc::PixelFormat_Float32, 43 new Orthanc::Image(Orthanc::PixelFormat_Float32, texture.GetWidth(), texture.GetHeight(), false));
39 texture.GetWidth(),
40 texture.GetHeight(),
41 false));
42
43 Orthanc::ImageProcessing::Convert(*t, texture); 44 Orthanc::ImageProcessing::Convert(*t, texture);
44 SetTexture(t.release()); 45 SetTexture(t.release());
45 } 46 }
46 47
47 SetLookupTableGrayscale(); // simple ramp between 0 and 255 48 SetLookupTableGrayscale(); // simple ramp between 0 and 255