|
92 | 92 | %-------------------------------------------------------------------------% |
93 | 93 |
|
94 | 94 | %-image name-% |
95 | | -obj.data{imageIndex}.name = image_data.DisplayName; |
| 95 | +try |
| 96 | + obj.data{imageIndex}.name = image_data.DisplayName; |
| 97 | +end |
96 | 98 |
|
97 | 99 | %-------------------------------------------------------------------------% |
98 | 100 |
|
|
117 | 119 | %-------------------------------------------------------------------------% |
118 | 120 |
|
119 | 121 | %-image zmax-% |
120 | | -obj.data{imageIndex}.zmax = axis_data.CLim(2); |
| 122 | +% axis_data.CLim(2); % comment this as optional |
| 123 | +obj.data{imageIndex}.zmax = 255; |
121 | 124 |
|
122 | 125 | %-------------------------------------------------------------------------% |
123 | 126 |
|
124 | 127 | %-COLORSCALE (ASSUMES IMAGE CDATAMAP IS 'SCALED')-% |
125 | 128 |
|
126 | 129 | %-image colorscale-% |
127 | 130 | colormap = figure_data.Colormap; |
| 131 | +len = length(colormap) - 1; |
128 | 132 |
|
129 | | -for c = 1:length(colormap) |
| 133 | +for c = 1:size(colormap, 1) |
130 | 134 | col = 255*(colormap(c,:)); |
131 | | - obj.data{imageIndex}.colorscale{c} = {(c-1)/length(colormap), ['rgb(' num2str(col(1)) ',' num2str(col(2)) ',' num2str(col(3)) ')']}; |
| 135 | + obj.data{imageIndex}.colorscale{c} = {(c-1)/len, ['rgb(' num2str(col(1)) ',' num2str(col(2)) ',' num2str(col(3)) ')']}; |
132 | 136 | end |
133 | 137 |
|
134 | 138 | %-------------------------------------------------------------------------% |
135 | 139 |
|
136 | 140 | %-image showlegend-% |
137 | | -leg = get(image_data.Annotation); |
138 | | -legInfo = get(leg.LegendInformation); |
139 | | - |
140 | | -switch legInfo.IconDisplayStyle |
141 | | - case 'on' |
142 | | - showleg = true; |
143 | | - case 'off' |
144 | | - showleg = false; |
| 141 | +try |
| 142 | + leg = get(image_data.Annotation); |
| 143 | + legInfo = get(leg.LegendInformation); |
| 144 | + |
| 145 | + switch legInfo.IconDisplayStyle |
| 146 | + case 'on' |
| 147 | + showleg = true; |
| 148 | + case 'off' |
| 149 | + showleg = false; |
| 150 | + end |
| 151 | + |
| 152 | + obj.data{imageIndex}.showlegend = showleg; |
145 | 153 | end |
146 | 154 |
|
147 | | -obj.data{imageIndex}.showlegend = showleg; |
148 | | - |
149 | 155 | %-------------------------------------------------------------------------% |
150 | 156 |
|
151 | 157 | end |
|
0 commit comments