Skip to content
Permalink
Browse files

updates to export multiple graphiclayers

  • Loading branch information...
adityaapte committed Aug 8, 2019
1 parent 712fe81 commit 1232f26dda753a8002f4b02fae0fd95869148f4c
@@ -136,9 +136,14 @@
tmp = org.dcm4che3.data.Attributes;
el = tmp.newSequence(tag, 0);

i = 1; % only 1 graphic layer
dcmobj = export_sequence(fHandle, templateEl, []);
el.add(i-1, dcmobj);
[uniqLabelC,indUniqV] = unique({gspsS.presentLabel});
numLabels = length(uniqLabelC);

for i = 1:numLabels
presentColor = gspsS(indUniqV(i)).presentRGBColor;
dcmobj = export_sequence(fHandle, templateEl, {uniqLabelC{i},i,presentColor});
el.add(i-1, dcmobj);
end

%get attribute to return
el = el.getParent();
@@ -1,5 +1,5 @@
function el = export_gsps_sequence(args)
%"export_gsps_sequence"
function el = export_graphic_layer_sequence(args)
%"export_graphic_layer_sequence"
% Subfunction to handle structure_set_ROI sequences within the
% structure_set module. Uses the same layout and principle as the parent
% function.
@@ -42,22 +42,29 @@
%Unpack input data.
tag = args.tag;
template = args.template;
layerLabel = args.data{1};
layerOrder = args.data{2};
layerColor = args.data{3};

switch tag
case 7340034 %0070,0002 Graphic Layer
data = 'CERR_LAYER';
data = layerLabel;
el = data2dcmElement(template, data, tag);

case 7340130 %0070,0062 Graphic Layer Order
data = 1; % Lower numbered layers are to be rendered first.
data = layerOrder; % Lower numbered layers are to be rendered first.
el = data2dcmElement(template, data, tag);

case 7340134 %0070,0066 Graphic Layer Recommended Display Grayscale Value
data = 255; %'FFFFH'; % white
el = data2dcmElement(template, data, tag);

case 7341057 %0070,0401 Graphic Layer Recommended Display CIELab Value
data = [80,80,80]; % cielab color. (this combination results in a shade of orange).
data = rgb2lab(layerColor); % cielab color. (this combination results in a shade of orange).

data(1) = data(1)/100*65535;
data(2) = (100+data(2))/200*65535;
data(3) = (100+data(3))/200*65535;
el = data2dcmElement(template, data, tag);

case 7340136 %0070,0068 Graphic Layer Description

0 comments on commit 1232f26

Please sign in to comment.
You can’t perform that action at this time.