loci.formats.ChannelSeparator Java Examples

The following examples show how to use loci.formats.ChannelSeparator. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: TiffConverter.java    From orbit-image-analysis with GNU General Public License v3.0 5 votes vote down vote up
public static int getNumPagesInZVI(String filename) throws IOException, FormatException {

        ImageProcessorReader r = new ImageProcessorReader(
                new ChannelSeparator(new ZeissZVIReader())); // LociPrefs.makeImageReader()
        r.setId(filename);
        int num = r.getImageCount();
        //int width = r.getSizeX();
        //int height = r.getSizeY();
        // howto color conversion: http://trac.openmicroscopy.org.uk/ome/browser/bioformats.git/components/loci-plugins/utils/Read_Image.java
        r.close();
        return num;
    }
 
Example #2
Source File: TiffConverter.java    From orbit-image-analysis with GNU General Public License v3.0 5 votes vote down vote up
public static int getNumPagesInLIF(String filename) throws IOException, FormatException {

        ImageProcessorReader r = new ImageProcessorReader(
                new ChannelSeparator(new LIFReader()));
        r.setId(filename);
        int num = r.getImageCount();
        r.close();
        return num;
    }
 
Example #3
Source File: TiffConverter.java    From orbit-image-analysis with GNU General Public License v3.0 5 votes vote down vote up
public static PlanarImage getZVIPage(String filename, int num) throws IOException, FormatException {
    ImageProcessorReader r = new ImageProcessorReader(
            new ChannelSeparator(new ZeissZVIReader())); // LociPrefs.makeImageReader()
    r.setId(filename);
    ImageProcessor ip = r.openProcessors(num)[0]; // (page)[0]
    return PlanarImage.wrapRenderedImage(ip.getBufferedImage());
}
 
Example #4
Source File: TiffConverter.java    From orbit-image-analysis with GNU General Public License v3.0 5 votes vote down vote up
public static PlanarImage getLIFPage(String filename, int num) throws IOException, FormatException {
    ImageProcessorReader r = new ImageProcessorReader(
            new ChannelSeparator(new LIFReader()));
    r.setId(filename);
    ImageProcessor ip = r.openProcessors(num)[0]; // (page)[0]
    return PlanarImage.wrapRenderedImage(ip.getBufferedImage());
}
 
Example #5
Source File: ImageFileHeader.java    From TrakEM2 with GNU General Public License v3.0 5 votes vote down vote up
/** Reads the header of the image file at {@code filepath}
 * using an {@link IFormatReader} from the bio-formats library,
 * and then extracts the {link #width}, {@link #height} and {@link #type}
 * of the image. If the type is not one supported by TrakEM2, the {@link #type}
 * is set to the value returned by {@link IFormatReader#getPixelType()}.
 * 
 * @param filepath
 * @throws Exception
 */
public ImageFileHeader(final String filepath) throws Exception {
	fr = new ChannelSeparator();
	fr.setGroupFiles(false);
	try {
		fr.setId(filepath);
		width = fr.getSizeX();
		height = fr.getSizeY();

		if (fr.isRGB()) {
			type = ImagePlus.COLOR_RGB;
		} else {
			switch (fr.getPixelType()) {
			case FormatTools.INT8:
			case FormatTools.UINT8:
				if (fr.isIndexed() || fr.isFalseColor()) {
					type = ImagePlus.COLOR_256;
				} else {
					type = ImagePlus.GRAY8;
				}
				break;
			case FormatTools.INT16:
			case FormatTools.UINT16:
				type = ImagePlus.GRAY16;
				break;
			case FormatTools.FLOAT:
				type = ImagePlus.GRAY32;
				break;
			default:
				type = fr.getPixelType();
				break;
			}
		}
	} finally {
		fr.close();
	}
}
 
Example #6
Source File: LegacyLightSheetZ1ImgLoader.java    From SPIM_Registration with GNU General Public License v2.0 4 votes vote down vote up
public static IFormatReader instantiateImageReader()
{
	// should I use the ZeissCZIReader here directly?
	return new ChannelSeparator();// new ZeissCZIReader();
}
 
Example #7
Source File: LegacySlideBook6ImgLoader.java    From SPIM_Registration with GNU General Public License v2.0 4 votes vote down vote up
public static IFormatReader instantiateImageReader()
{
	// should I use the ZeissCZIReader here directly?
	return new ChannelSeparator();// new ZeissCZIReader();
}