我使用CSI DM3 Reader(http://code.google.com/p/cornell-spectrum-imager/wiki/Home)来读取我的.dm3文件。我想添加拖动和放大器为此删除功能,所以我更改了文件HandleExtraFileTypes.java(http://rsbweb.nih.gov/ij/plugins/download/HandleExtraFileTypes.java)并更改了第101-103行中的.dm3关联
if (name.endsWith(".dm3") && buf[0]==0 && buf[1]==0 && buf[2]==0 && buf[3]==3) {
return tryPlugIn("DM3_Reader", path);
}
到
if (name.endsWith(".dm3") && buf[0]==0 && buf[1]==0 && buf[2]==0 && buf[3]==3) {
return tryPlugIn("CSI_DM3_Reader", path);
}
这将在CSI DM3阅读器和标准DM3阅读器中打开文件,我希望它只在CSI DM3阅读器中打开。如何抑制ImageJ打开常规DM3阅读器?
注意:tryPlugIn对象如下
/**
* Attempts to open the specified path with the given plugin. If the
* plugin extends the ImagePlus class (e.g., BioRad_Reader), set
* extendsImagePlus to true, otherwise (e.g., LSM_Reader) set it to false.
*
* @return A reference to the plugin, if it was successful.
*/
private Object tryPlugIn(String className, String path) {
Object o = IJ.runPlugIn(className, path);
if (o instanceof ImagePlus) {
// plugin extends ImagePlus class
ImagePlus imp = (ImagePlus)o;
if (imp.getWidth()==0)
o = null; // invalid image
else
width = IMAGE_OPENED; // success
} else {
// plugin does not extend ImagePlus; assume success
width = IMAGE_OPENED;
}
return o;
}