|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.toronto.psi.vincent.util.ImageReaderWriter
public class ImageReaderWriter
Class for reading images from files to multidimensional arrays and writing multidimensional arrays to image files. The supported image formats are those natively supported by Java, i.e. JPEG, GIF, PNG
Copyright (C) 2005 Vincent Cheung (vincent@psi.toronto.edu, http://www.vincentcheung.ca/research/) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
Constructor Summary | |
---|---|
ImageReaderWriter()
|
Method Summary | |
---|---|
static double[][][] |
read(java.lang.String filename)
Reads an image from a file. |
static double[][][][] |
read(java.lang.String prefix,
java.lang.String postfix,
int numFrames)
Reads a video sequence from a set of image files. |
static float[][][] |
readFloat(java.lang.String filename)
Reads an image from a file. |
static float[][][][] |
readFloat(java.lang.String prefix,
java.lang.String postfix,
int numFrames)
Reads a video sequence from a set of image files. |
static int[][][] |
readInt(java.lang.String filename)
Reads an image from a file. |
static int[][][][] |
readInt(java.lang.String prefix,
java.lang.String postfix,
int numFrames)
Reads a video sequence from a set of image files. |
static void |
write(boolean[][][] samples,
java.lang.String prefix,
java.lang.String postfix)
Writes a video sequence as a set of images. |
static void |
write(boolean[][] samples,
java.lang.String filename)
Writes an image to a file. |
static void |
write(double[][][][] samples,
java.lang.String prefix,
java.lang.String postfix)
Writes a video sequence as a set of images. |
static void |
write(double[][][] samples,
java.lang.String filename)
Writes an image to a file. |
static void |
write(double[][] samples,
java.lang.String filename)
Writes a gray scale image to a file. |
static void |
write(float[][][][] samples,
java.lang.String prefix,
java.lang.String postfix)
Writes a video sequence as a set of images. |
static void |
write(float[][][] samples,
java.lang.String filename)
Writes an image to a file. |
static void |
write(float[][] samples,
java.lang.String filename)
Writes a gray scale image to a file. |
static void |
write(int[][][][] samples,
java.lang.String prefix,
java.lang.String postfix)
Writes a video sequence as a set of images. |
static void |
write(int[][][] samples,
java.lang.String filename)
Writes an image to a file. |
static void |
write(int[][] samples,
java.lang.String filename)
Writes a gray scale image to a file. |
static void |
writeScaledGray(double[][][][] samples,
java.lang.String prefix,
java.lang.String postfix)
Writes a video as a set of gray scale images by summing over the RGB values, then rescaling to use the full gray scale. |
static void |
writeScaledGray(double[][][] samples,
java.lang.String filename)
Writes an image as a gray scale image by summing over the RGB values, then rescaling to use the full gray scale. |
static void |
writeScaledGray(double[][] gray,
double maxVal,
double minVal,
java.lang.String filename)
Writes an image as a gray scale image by summing over the RGB values, then rescaling to use the full gray scale |
static void |
writeScaledGray(float[][][][] samples,
java.lang.String prefix,
java.lang.String postfix)
Writes a video as a set of gray scale images by summing over the RGB values, then rescaling to use the full gray scale. |
static void |
writeScaledGray(float[][][] samples,
java.lang.String filename)
Writes an image as a gray scale image by summing over the RGB values, then rescaling to use the full gray scale. |
static void |
writeScaledGray(int[][][][] samples,
java.lang.String prefix,
java.lang.String postfix)
Writes a video as a set of gray scale images by summing over the RGB values, then rescaling to use the full gray scale. |
static void |
writeScaledGray(int[][][] samples,
java.lang.String filename)
Writes an image as a gray scale image by summing over the RGB values, then rescaling to use the full gray scale. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ImageReaderWriter()
Method Detail |
---|
public static double[][][] read(java.lang.String filename) throws java.io.IOException
filename
- the name of the image file
java.io.IOException
public static double[][][][] read(java.lang.String prefix, java.lang.String postfix, int numFrames) throws java.io.IOException
prefix
- the prefix of the name of the image filepostfix
- the postfix of the name of the image filenumFrames
- the number of frames to read
java.io.IOException
public static void write(double[][][] samples, java.lang.String filename) throws java.io.IOException
samples
- a multidimensional array holding the separate RGB components normalized between 0 and 1filename
- the name of the image file
java.io.IOException
public static void write(double[][] samples, java.lang.String filename) throws java.io.IOException
samples
- a multidimensional array holding the gray values normalized between 0 and 1filename
- the name of the image file
java.io.IOException
public static void write(double[][][][] samples, java.lang.String prefix, java.lang.String postfix) throws java.io.IOException
samples
- a multidimensional array holding the separate RGB components normalized between 0 and 1,
where the first dimension indexes the frame and the remaining dimensions represent the frame imageprefix
- the prefix of the name of the image filepostfix
- the postfix of the name of the image file
java.io.IOException
public static void writeScaledGray(double[][][] samples, java.lang.String filename) throws java.io.IOException
samples
- a multidimensional array holding the separate RGB components normalized between 0 and 1filename
- the base filename of the image file
java.io.IOException
public static void writeScaledGray(double[][] gray, double maxVal, double minVal, java.lang.String filename) throws java.io.IOException
gray
- a multidimensional array holding the summed RGB componentsfilename
- the base filename of the image file
java.io.IOException
public static void writeScaledGray(double[][][][] samples, java.lang.String prefix, java.lang.String postfix) throws java.io.IOException
samples
- a multidimensional array holding the separate RGB components normalized between 0 and 1,
where the first dimension indexes the frame and the remaining dimensions represent the frame imageprefix
- the prefix of the name of the image filepostfix
- the postfix of the name of the image file
java.io.IOException
public static int[][][] readInt(java.lang.String filename) throws java.io.IOException
filename
- the name of the image file
java.io.IOException
public static int[][][][] readInt(java.lang.String prefix, java.lang.String postfix, int numFrames) throws java.io.IOException
prefix
- the prefix of the name of the image filepostfix
- the postfix of the name of the image filenumFrames
- the number of frames to read
java.io.IOException
public static void write(int[][][] samples, java.lang.String filename) throws java.io.IOException
samples
- a multidimensional array holding the separate RGB components with values between 0 and 255filename
- the name of the image file
java.io.IOException
public static void write(int[][] samples, java.lang.String filename) throws java.io.IOException
samples
- a multidimensional array holding the gray values with values between 0 and 255filename
- the name of the image file
java.io.IOException
public static void write(int[][][][] samples, java.lang.String prefix, java.lang.String postfix) throws java.io.IOException
samples
- a multidimensional array holding the separate RGB components with values between 0 and 255,
where the first dimension indexes the frame and the remaining dimensions represent the frame imageprefix
- the prefix of the name of the image filepostfix
- the postfix of the name of the image file
java.io.IOException
public static void writeScaledGray(int[][][] samples, java.lang.String filename) throws java.io.IOException
samples
- a multidimensional array holding the separate RGB components with values between 0 and 255filename
- the base filename of the image file
java.io.IOException
public static void writeScaledGray(int[][][][] samples, java.lang.String prefix, java.lang.String postfix) throws java.io.IOException
samples
- a multidimensional array holding the separate RGB components with values between 0 and 255,
where the first dimension indexes the frame and the remaining dimensions represent the frame imageprefix
- the prefix of the name of the image filepostfix
- the postfix of the name of the image file
java.io.IOException
public static float[][][] readFloat(java.lang.String filename) throws java.io.IOException
filename
- the name of the image file
java.io.IOException
public static float[][][][] readFloat(java.lang.String prefix, java.lang.String postfix, int numFrames) throws java.io.IOException
prefix
- the prefix of the name of the image filepostfix
- the postfix of the name of the image filenumFrames
- the number of frames to read
java.io.IOException
public static void write(float[][][] samples, java.lang.String filename) throws java.io.IOException
samples
- a multidimensional array holding the separate RGB components normalized between 0 and 1filename
- the name of the image file
java.io.IOException
public static void write(float[][][][] samples, java.lang.String prefix, java.lang.String postfix) throws java.io.IOException
samples
- a multidimensional array holding the separate RGB components normalized between 0 and 1,
where the first dimension indexes the frame and the remaining dimensions represent the frame imageprefix
- the prefix of the name of the image filepostfix
- the postfix of the name of the image file
java.io.IOException
public static void write(float[][] samples, java.lang.String filename) throws java.io.IOException
samples
- a multidimensional array holding the gray values normalized between 0 and 1filename
- the name of the image file
java.io.IOException
public static void writeScaledGray(float[][][] samples, java.lang.String filename) throws java.io.IOException
samples
- a multidimensional array holding the separate RGB components normalized between 0 and 1filename
- the base filename of the image file
java.io.IOException
public static void writeScaledGray(float[][][][] samples, java.lang.String prefix, java.lang.String postfix) throws java.io.IOException
samples
- a multidimensional array holding the separate RGB components normalized between 0 and 1,
where the first dimension indexes the frame and the remaining dimensions represent the frame imageprefix
- the prefix of the name of the image filepostfix
- the postfix of the name of the image file
java.io.IOException
public static void write(boolean[][] samples, java.lang.String filename) throws java.io.IOException
samples
- a multidimensional array holding the separate RGB components normalized between 0 and 1filename
- the name of the image file
java.io.IOException
public static void write(boolean[][][] samples, java.lang.String prefix, java.lang.String postfix) throws java.io.IOException
samples
- a multidimensional array holding the separate RGB components normalized between 0 and 1,
where the first dimension indexes the frame and the remaining dimensions represent the frame imageprefix
- the prefix of the name of the image filepostfix
- the postfix of the name of the image file
java.io.IOException
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |