private ImageProcessor getProcessor() { imp.setPositionWithoutUpdate(channel, slice, frame); final ImageProcessor ip = imp.getChannelProcessor(); if (ip instanceof FloatProcessor || ip instanceof ColorProcessor) return new TypeConverter(ip, false).convertToShort(); return ip; } }
void updateLut() { IndexColorModel cm = (IndexColorModel)imp.getChannelProcessor().getColorModel(); if (mapSize == 0) return; cm.getReds(reds); cm.getGreens(greens); cm.getBlues(blues); for(int i=0; i<mapSize; i++) c[i] = new Color(reds[i]&255, greens[i]&255, blues[i]&255); }
void updateLut() { IndexColorModel cm = (IndexColorModel)imp.getChannelProcessor().getColorModel(); if (mapSize == 0) return; cm.getReds(reds); cm.getGreens(greens); cm.getBlues(blues); for(int i=0; i<mapSize; i++) c[i] = new Color(reds[i]&255, greens[i]&255, blues[i]&255); }
double scale; ip = imp.getChannelProcessor(); IndexColorModel cm = (IndexColorModel)ip.getColorModel(); LookUpTable lut = new LookUpTable(cm);
double scale; ip = imp.getChannelProcessor(); IndexColorModel cm = (IndexColorModel)ip.getColorModel(); LookUpTable lut = new LookUpTable(cm);
rtnVal.getChannelProcessor().setPixels(packagedInts);
public void setup(ImagePlus imp) { if (imp==null) { IJ.noImage(); return; } this.imp = imp; bitDepth = imp.getBitDepth(); ImageProcessor ip = imp.getChannelProcessor(); IndexColorModel cm = (IndexColorModel)ip.getColorModel(); origin = cm; mapSize = cm.getMapSize(); reds = new byte[256]; greens = new byte[256]; blues = new byte[256]; cm.getReds(reds); cm.getGreens(greens); cm.getBlues(blues); addMouseListener(this); addMouseMotionListener(this); for(int index = 0; index < mapSize; index++) c[index] = new Color(reds[index]&255, greens[index]&255, blues[index]&255); }
public void setup(ImagePlus imp) { if (imp==null) { IJ.noImage(); return; } this.imp = imp; bitDepth = imp.getBitDepth(); ImageProcessor ip = imp.getChannelProcessor(); IndexColorModel cm = (IndexColorModel)ip.getColorModel(); origin = cm; mapSize = cm.getMapSize(); reds = new byte[256]; greens = new byte[256]; blues = new byte[256]; cm.getReds(reds); cm.getGreens(greens); cm.getBlues(blues); addMouseListener(this); addMouseMotionListener(this); for(int index = 0; index < mapSize; index++) c[index] = new Color(reds[index]&255, greens[index]&255, blues[index]&255); }
else { // 8/16-bit grayscale image ip = (img.isComposite()) ? img.getChannelProcessor() : img.getProcessor(); final double lower = ip.getMinThreshold(); if (lower != ImageProcessor.NO_THRESHOLD) {
private ImageProcessor projImp() { ImageProcessor ip; final ZProjector zp = new ZProjector(imp); zp.setMethod(ZProjector.MAX_METHOD); zp.setStartSlice(minZ); zp.setStopSlice(maxZ); if (imp.isComposite()) { zp.doHyperStackProjection(false); final ImagePlus projImp = zp.getProjection(); projImp.setC(channel); ip = projImp.getChannelProcessor(); } else { zp.doProjection(); ip = zp.getProjection().getProcessor(); } return ip; }
public void applyLUT() { byte[] reds2=reds, greens2=greens, blues2=blues; if (mapSize<256) { reds2 = new byte[256]; greens2 = new byte[256]; blues2 = new byte[256]; for(int i = 0; i < mapSize; i++) { reds2[i] = reds[i]; greens2[i] = greens[i]; blues2[i] = blues[i]; } scale(reds2, greens2, blues2, 256); } IndexColorModel cm = new IndexColorModel(8, 256, reds2, greens2, blues2); ImageProcessor ip = imp.getChannelProcessor(); ip.setColorModel(cm); if (imp.isComposite()) ((CompositeImage)imp).setChannelColorModel(cm); if (imp.getStackSize()>1 && !imp.isComposite()) imp.getStack().setColorModel(cm); imp.updateAndDraw(); }
public void applyLUT() { byte[] reds2=reds, greens2=greens, blues2=blues; if (mapSize<256) { reds2 = new byte[256]; greens2 = new byte[256]; blues2 = new byte[256]; for(int i = 0; i < mapSize; i++) { reds2[i] = reds[i]; greens2[i] = greens[i]; blues2[i] = blues[i]; } scale(reds2, greens2, blues2, 256); } IndexColorModel cm = new IndexColorModel(8, 256, reds2, greens2, blues2); ImageProcessor ip = imp.getChannelProcessor(); ip.setColorModel(cm); if (imp.isComposite()) ((CompositeImage)imp).setChannelColorModel(cm); if (imp.getStackSize()>1 && !imp.isComposite()) imp.getStack().setColorModel(cm); imp.updateAndDraw(); }
resultStack.addSlice(availableFeatures[GABOR] + "_" + i +"_"+sigma+"_" + gamma + "_"+ (int) (psi / (Math.PI/4) ) +"_"+frequency, zp.getProjection().getChannelProcessor());
zp.setMethod(i); zp.doProjection(); membraneStack.addSlice(availableFeatures[MEMBRANE] + "_" +i+"_"+patchSize+"_"+membraneSize, zp.getProjection().getChannelProcessor());
zp.setMethod(i); zp.doProjection(); membraneStack.addSlice(availableFeatures[MEMBRANE] + "_" +i+"_"+patchSize+"_"+membraneSize, zp.getProjection().getChannelProcessor());
zp.setMethod(i); zp.doProjection(); membraneStack.addSlice(availableFeatures[MEMBRANE] + "_" +i+"_"+patchSize+"_"+membraneSize, zp.getProjection().getChannelProcessor());
zp.setMethod(i); zp.doProjection(); membraneStack.addSlice(availableFeatures[MEMBRANE] + "_" +i+"_"+patchSize+"_"+membraneSize, zp.getProjection().getChannelProcessor());
ImageProcessor inputIP = input.getChannelProcessor();
imp.updateAndRepaintWindow(); } else { ImageProcessor ip = imp.getChannelProcessor(); IndexColorModel cm = new IndexColorModel(8, 256, fi.reds, fi.greens, fi.blues); if (imp.isComposite())
imp.updateAndRepaintWindow(); } else { ImageProcessor ip = imp.getChannelProcessor(); IndexColorModel cm = new IndexColorModel(8, 256, fi.reds, fi.greens, fi.blues); if (imp.isComposite())