(int channels)
| 148 | } |
| 149 | |
| 150 | void setupLuts(int channels) { |
| 151 | if (ip==null) |
| 152 | return; |
| 153 | if (lut==null || lut.length<channels) { |
| 154 | if (displayRanges!=null && channels!=displayRanges.length/2) |
| 155 | displayRanges = null; |
| 156 | if (displayRanges==null&&ip.getMin()==0.0&&ip.getMax()==0.0) |
| 157 | ip.resetMinAndMax(); |
| 158 | lut = new LUT[channels]; |
| 159 | LUT lut2 = channels>MAX_CHANNELS?createLutFromColor(Color.white):null; |
| 160 | for (int i=0; i<channels; ++i) { |
| 161 | if (channelLuts!=null && i<channelLuts.length) { |
| 162 | lut[i] = createLutFromBytes(channelLuts[i]); |
| 163 | customLuts = true; |
| 164 | } else if (i<MAX_CHANNELS) |
| 165 | lut[i] = createLutFromColor(colors[i]); |
| 166 | else |
| 167 | lut[i] = (LUT)lut2.clone(); |
| 168 | if (displayRanges!=null) { |
| 169 | lut[i].min = displayRanges[i*2]; |
| 170 | lut[i].max = displayRanges[i*2+1]; |
| 171 | } else { |
| 172 | lut[i].min = ip.getMin(); |
| 173 | lut[i].max = ip.getMax(); |
| 174 | } |
| 175 | } |
| 176 | displayRanges = null; |
| 177 | } |
| 178 | } |
| 179 | |
| 180 | public void resetDisplayRanges() { |
| 181 | int channels = getNChannels(); |
no test coverage detected