MCPcopy Create free account
hub / github.com/AstroImageJ/astroimagej / convertType

Method convertType

ij/src/main/java/ij/ImageStack.java:137–150  ·  view source on GitHub ↗
(ImageProcessor ip)

Source from the content-addressed store, hash-verified

135 }
136
137 private ImageProcessor convertType(ImageProcessor ip) {
138 int newBitDepth = ip.getBitDepth();
139 if (this.bitDepth==0)
140 this.bitDepth = newBitDepth;
141 if (this.bitDepth!=newBitDepth) {
142 switch (this.bitDepth) {
143 case 8: ip=ip.convertToByte(true); break;
144 case 16: ip=ip.convertToShort(true); break;
145 case 24: ip=ip.convertToRGB(); break;
146 case 32: ip=ip.convertToFloat(); break;
147 }
148 }
149 return ip;
150 }
151
152 /** Adds the image in 'ip' to the stack following slice 'n'. Adds
153 the slice to the beginning of the stack if 'n' is zero. */

Callers 2

addSliceMethod · 0.95
setProcessorMethod · 0.95

Calls 5

getBitDepthMethod · 0.45
convertToByteMethod · 0.45
convertToShortMethod · 0.45
convertToRGBMethod · 0.45
convertToFloatMethod · 0.45

Tested by

no test coverage detected