本文整理汇总了Java中ij.io.FileInfo.GRAY32_FLOAT属性的典型用法代码示例。如果您正苦于以下问题:Java FileInfo.GRAY32_FLOAT属性的具体用法?Java FileInfo.GRAY32_FLOAT怎么用?Java FileInfo.GRAY32_FLOAT使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类ij.io.FileInfo
的用法示例。
在下文中一共展示了FileInfo.GRAY32_FLOAT属性的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: imgType
public static String imgType(int fiType) {
switch (fiType) {
case FileInfo.GRAY32_FLOAT:
return "float";
case FileInfo.GRAY32_INT:
return "int32";
case FileInfo.GRAY32_UNSIGNED:
return "uint32";
case FileInfo.GRAY16_SIGNED:
return "int16";
case FileInfo.GRAY16_UNSIGNED:
return "uint16";
case FileInfo.COLOR8:
case FileInfo.GRAY8:
return "uint8";
default:
return "unsupported";
}
}
示例2: getHeaderInfo
/**
* Reads the header information from the file into a fileinfo object
* @param filename the filename
* @return the FileInfo
* @throws IOException
*/
public FileInfo getHeaderInfo( String filename ) throws IOException {
if (IJ.debugMode) CONRAD.log("Entering Nrrd_Reader.readHeader():");
FileInfo fi = new FileInfo();
File file = new File(filename);
fi.fileName=file.getName();
fi.directory = file.getParent() + "/";
// NB Need RAF in order to ensure that we know file offset
RandomAccessFile input = new RandomAccessFile(fi.directory+fi.fileName,"r");
fi.fileType = FileInfo.GRAY8; // just assume this for the mo
fi.fileFormat = FileInfo.RAW;
fi.nImages = 1;
byte [] header = new byte [6];
input.read(header);
fi.width = (int) convertToUnsignedShort(header, 0);
fi.height = (int) convertToUnsignedShort(header, 1);
fi.nImages = (int) convertToUnsignedShort(header, 2);
CONRAD.log("Dennerlein Reading image with " + fi.nImages + " frames with " + fi.width + "x" + fi.height + " resolution");
fi.compression = FileInfo.COMPRESSION_NONE;
fi.fileType=FileInfo.GRAY32_FLOAT;
// exception for projection matrix data
if (fi.width == 3 && fi.height == 4){
fi.width = 4;
fi.height = 3;
fi.fileType=FileInfo.GRAY64_FLOAT;
}
if (fi.width == 4 && fi.height == 3){
fi.fileType=FileInfo.GRAY64_FLOAT;
}
fi.offset = 6;
fi.intelByteOrder = true;
input.close();
return (fi);
}
示例3: getDefaultFloat32LittleEndianFileInfo
/**
* The default float 32, little endian format for CONRAD.
* @return the FileInfo object
*/
public static FileInfo getDefaultFloat32LittleEndianFileInfo(){
FileInfo fI = new FileInfo();
fI.fileFormat = FileInfo.RAW;
fI.fileType = FileInfo.GRAY32_FLOAT;
fI.height = 256;
fI.width = 256;
fI.nImages = 1;
fI.intelByteOrder = true;
fI.directory = "";
fI.fileName = "";
return fI;
}
示例4: getDefaultFloat32BigEndianFileInfo
/**
* The default float 32, big endian format for CONRAD.
* @return the FileInfo object
*/
public static FileInfo getDefaultFloat32BigEndianFileInfo(){
FileInfo fI = new FileInfo();
fI.fileFormat = FileInfo.RAW;
fI.fileType = FileInfo.GRAY32_FLOAT;
fI.height = 256;
fI.width = 256;
fI.nImages = 1;
fI.intelByteOrder = false;
fI.directory = "";
fI.fileName = "";
return fI;
}
示例5: getFileInfo
public FileInfo getFileInfo(){
FileInfo fi = new FileInfo();
fi.fileFormat = FileInfo.RAW;
fi.fileType = FileInfo.GRAY8;
fi.height = Integer.parseInt(this.jTextFieldHeight.getText());
fi.width = Integer.parseInt(this.jTextFieldWidth.getText());
fi.nImages = Integer.parseInt(this.jTextFieldStack.getText());
fi.offset = Integer.parseInt(getJOffset().getText());
if (this.jButtonBig.isSelected()){
fi.intelByteOrder = false;
}
if (this.jButtonLittle.isSelected()){
fi.intelByteOrder = true;
}
if (this.jButtonShort.isSelected()){
fi.fileType=FileInfo.GRAY16_UNSIGNED;
}
if (this.jButtonSShort.isSelected()){
fi.fileType=FileInfo.GRAY16_SIGNED;
}
if (this.jButtonFloat.isSelected()){
fi.fileType=FileInfo.GRAY32_FLOAT;
}
if (this.jButtonDouble.isSelected()){
fi.fileType=FileInfo.GRAY64_FLOAT;
}
return fi;
}