void verifyDimensions() { int stackSize = getImageStackSize(); if (nSlices==1) { if (nChannels>1 && nFrames==1) nChannels = stackSize; else if (nFrames>1 && nChannels==1) nFrames = stackSize; } if (nChannels*nSlices*nFrames!=stackSize) { nSlices = stackSize; nChannels = 1; nFrames = 1; } }
void verifyDimensions() { int stackSize = getImageStackSize(); if (nSlices==1) { if (nChannels>1 && nFrames==1) nChannels = stackSize; else if (nFrames>1 && nChannels==1) nFrames = stackSize; } if (nChannels*nSlices*nFrames!=stackSize) { nSlices = stackSize; nChannels = 1; nFrames = 1; } }
/** * Set connectivity value in the GUI * * @param connectivity 4-8 or 6-26 neighbor connectivity */ void setConnectivity( int connectivity ) { if( ( inputImage.getImageStackSize() > 1 && (connectivity == 6 || connectivity == 26 ) ) || ( inputImage.getImageStackSize() == 1 && (connectivity == 4 || connectivity == 8 ) ) ) connectivityList.setSelectedItem( Integer.toString(connectivity) ); }
/** * Set connectivity value in the GUI * * @param connectivity 4-8 or 6-26 neighbor connectivity */ void setConnectivity( int connectivity ) { if( ( inputImage.getImageStackSize() > 1 && (connectivity == 6 || connectivity == 26 ) ) || ( inputImage.getImageStackSize() == 1 && (connectivity == 4 || connectivity == 8 ) ) ) connectivityList.setSelectedItem( Integer.toString(connectivity) ); }
/** * Add new segmentation class. */ public void addClass() { if(null != trainingImage) for(int i=1; i <= trainingImage.getImageStackSize(); i++) examples[i-1].add(new ArrayList<Roi>()); // increase number of available classes numOfClasses ++; }
/** * Add new segmentation class. */ public void addClass() { if(null != trainingImage) for(int i=1; i <= trainingImage.getImageStackSize(); i++) examples[i-1].add(new ArrayList<Roi>()); // increase number of available classes numOfClasses ++; }
int nrframes() { int val = 1; switch (imagetype) { case IMAGE5D: case HYPERSTACK: val = image.getNFrames(); break; case IMAGESTACK: val = image.getImageStackSize(); break; case SINGLEIMAGE: break; } return val; }
boolean doframes() { boolean val = false; switch (imagetype) { case IMAGE5D: case HYPERSTACK: val = (image.getNFrames() > 1); break; case IMAGESTACK: val = (image.getImageStackSize() > 1); break; case SINGLEIMAGE: break; } return val; }
private boolean isStack(ImagePlus imp) { if(imp == null) { IJ.error("No image open."); return false; } if(imp.getImageStackSize() < 2) { IJ.error("Requires a stack."); return false; } return true; }
static int type(final ImagePlus imp) { int type = SINGLEIMAGE; boolean i5dexist = false; try { Class.forName("i5d.Image5D"); i5dexist = true; } catch (Throwable e) { } if (i5dexist && I5DResource.instance(imp)) type = IMAGE5D; else if (imp.isComposite()) type = COMPOSITEIMAGE; else if (imp.isHyperStack()) type = HYPERSTACK; else if (imp.getImageStackSize() > 1) type = IMAGESTACK; return type; }
private static int type(final ImagePlus imp) { int type = SINGLEIMAGE; boolean i5dexist = false; try { Class.forName("i5d.Image5D"); i5dexist = true; } catch (Throwable e) { } if (i5dexist && I5DResource.instance(imp)) type = IMAGE5D; else if (imp.isComposite()) type = COMPOSITEIMAGE; else if (imp.isHyperStack()) type = HYPERSTACK; else if (imp.getImageStackSize() > 1) type = IMAGESTACK; return type; }
/** * Computes the maximum value in the input image or stack, in order to * initialize colormap with the appropriate number of colors. */ private final static int computeMaxLabel(ImagePlus imagePlus) { if (imagePlus.getImageStackSize() == 1) { return computeMaxLabel(imagePlus.getProcessor()); } else { return computeMaxLabel(imagePlus.getStack()); } }
/** * bag class for getting the result of the loaded classifier */ private static class LoadedClassifier { private AbstractClassifier newClassifier = null; private Instances newHeader = null; }
/** * bag class for getting the result of the loaded classifier */ private static class LoadedClassifier { private AbstractClassifier newClassifier = null; private Instances newHeader = null; }
/** * Add Hessian features from original image (single thread version). * The features include a scalar representing the Hessian, the trace, determinant, * 1st eigenvalue, 2nd eigenvalue, orientation, gamma-normalized square eigenvalue difference * and the square of Gamma-normalized eigenvalue difference * * @param sigma radius of the Gaussian filter to use */ public void addHessian(float sigma) { ImagePlus merged = calculateHessian(originalImage, sigma); for(int i=1; i<=merged.getImageStackSize(); i++) wholeStack.addSlice(merged.getImageStack().getSliceLabel(i), merged.getImageStack().getPixels(i)); }
/** * Add Hessian features from original image (single thread version). * The features include a scalar representing the Hessian, the trace, determinant, * 1st eigenvalue, 2nd eigenvalue, orientation, gamma-normalized square eigenvalue difference * and the square of Gamma-normalized eigenvalue difference * * @param sigma radius of the Gaussian filter to use */ public void addHessian(float sigma) { ImagePlus merged = calculateHessian(originalImage, sigma); for(int i=1; i<=merged.getImageStackSize(); i++) wholeStack.addSlice(merged.getImageStack().getSliceLabel(i), merged.getImageStack().getPixels(i)); }
/** * Add HSB features */ public void addHSB() { final ImagePlus hsb = originalImage.duplicate(); ImageConverter ic = new ImageConverter( hsb ); ic.convertToHSB(); for(int n=1; n<=hsb.getImageStackSize(); n++) wholeStack.addSlice(hsb.getImageStack().getSliceLabel(n), hsb.getImageStack().getProcessor(n).convertToRGB()); }
/** * Add HSB features */ public void addHSB() { final ImagePlus hsb = originalImage.duplicate(); ImageConverter ic = new ImageConverter( hsb ); ic.convertToHSB(); for(int n=1; n<=hsb.getImageStackSize(); n++) wholeStack.addSlice(hsb.getImageStack().getSliceLabel(n), hsb.getImageStack().getProcessor(n).convertToRGB()); }
public ImagePlus call(){ final ImagePlus hsb = originalImage.duplicate(); ImageConverter ic = new ImageConverter( hsb ); ic.convertToHSB(); ImageStack is = new ImageStack(originalImage.getWidth(), originalImage.getHeight()); for(int n=1; n<=hsb.getImageStackSize(); n++) is.addSlice(hsb.getImageStack().getSliceLabel(n), hsb.getImageStack().getProcessor(n).convertToRGB()); return new ImagePlus ("HSB", is); } };
public ImagePlus call(){ final ImagePlus hsb = originalImage.duplicate(); ImageConverter ic = new ImageConverter( hsb ); ic.convertToHSB(); ImageStack is = new ImageStack(originalImage.getWidth(), originalImage.getHeight()); for(int n=1; n<=hsb.getImageStackSize(); n++) is.addSlice(hsb.getImageStack().getSliceLabel(n), hsb.getImageStack().getProcessor(n).convertToRGB()); return new ImagePlus ("HSB", is); } };