java - Image J 16 bit Signed Buffered Image -


So my question is how to get 16 bit buffed image from ij.ImagePlus ...? If trying to use a smallprocessor then it changes my signed image to unsigned, so I can not find the original image ... Thanks in advance, anyone can provide the solution.

Enter image details here

How ImageJ is in your audience Displays the 16-bit signed image..and we only receive 8-bit buffed image or 16 bit unsigned BufferedImage so how can I get 16-bit signed BufferedImage?

Type the imageJ using signed 16-bit special calibration function < Code> isigned1bit () The method indicates that when the specific calibration function is in use, it is a linear M * x + b calibration where m = 1 and b = -32768; It can be possible.

ImageJ provides a way to get the getImage () method from a BufferedImage to a ImagePlus . However, this is it.

Then create your first BufferedImage with type DataBuffer.TYPE_SHORT , which is the same short [] array which The original ImagePlus takes the object back, unfortunately, due to the internal representation of the signed 16-bit data of ImageJ, the value will be closed by a constant offset of 32768, for example a crude of -444 Value ImageJ's small [] array 32324. Due to this fact, before you wrap it in the form of BufferedImage Must be adjusted manually.

Here are some example codes:

  Import io.scif.gui.AWTImageTools; ... Final ImagePlus IP = IJ.openImage ("http://imagej.net/images/ct.dcm.zip"); // pixel array reference last abbreviated [] pix = (less []) imp.getProcessor (). GetPixels (); Final int w = imp.getWidth (); Last int H = imp. Guesthit (); Last Boolean signed = imp.getCalibration (). IsSigned16Bit (); If used to adjust the (// sign) {// raw pixel value (int i = 0; i & lt; pix.length; i ++) {pix [i] - = 32768; }} // BufferedImage Last BufferedImage image = Convert AWTImageTools.makeImage (pix, w, h, sign); For the actual conversion of  less <>  to  BufferedImage , this code uses the library's utility methods, along with SCIFIO, optionally, only a few of these codes Rows that are easier to copy and paste in a regular question.   

Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -