public String getPositionYUnit(int plane) { return currentTable.get(Y_POSITION_UNIT + plane); }
/** * Flattens all of the INI tables into a single HashMap whose keys are * of the format "[table name] table key". */ public HashMap<String, String> flattenIntoHashMap() { HashMap<String, String> h = new HashMap<String, String>(); for (IniTable table : this) { String tableName = table.get(IniTable.HEADER_KEY); for (String key : table.keySet()) { if (!key.equals(IniTable.HEADER_KEY)) { h.put("[" + tableName + "] " + key, table.get(key)); } } } return h; }
public boolean hasExposureTime(int channel) { return currentTable.containsKey(EXPOSURE_TIME + channel); }
private IniList getIniFile(String filename) throws FormatException, IOException { LOGGER.debug("getIniFile procession: {}", filename); RandomAccessInputStream stream = getFile(filename); String data = stream.readString((int) stream.length()); if (!data.startsWith("[")) { data = data.substring(data.indexOf('['), data.length()); } data = DataTools.stripString(data); BufferedReader reader = new BufferedReader(new StringReader(data)); stream.close(); IniList list = parser.parseINI(reader); // most of the values will be wrapped in double quotes for (IniTable table : list) { LOGGER.debug(""); LOGGER.debug("[" + table.get(IniTable.HEADER_KEY) + "]"); String[] keys = table.keySet().toArray(new String[table.size()]); for (String key : keys) { String value = sanitizeValue(table.get(key)); LOGGER.debug(key + " = " + value); table.put(key, value); } } reader.close(); return list; }
String[] saveKeys = saveInfo.keySet().toArray(new String[saveInfo.size()]); for (String key : saveKeys) { String value = saveInfo.get(key).toString(); value = sanitizeValue(value).trim(); code[i] = commonParams.get("AxisCode"); size[i] = commonParams.get("MaxSize"); double end = Double.parseDouble(commonParams.get("EndPosition")); double start = Double.parseDouble(commonParams.get("StartPosition")); pixelSize[i] = end - start; imageDepth = Integer.parseInt(referenceParams.get("ImageDepth")); pixelSizeX = referenceParams.get("WidthConvertValue"); pixelSizeY = referenceParams.get("HeightConvertValue"); String ripValidBitCounts = referenceParams.get("ValidBitCounts"); if (ripValidBitCounts != null) { validBits = Integer.parseInt(ripValidBitCounts); laserEnabled = laser.get("Laser Enable").equals("1"); if (laserEnabled) { wavelengths.add(new Double(laser.get("LaserWavelength"))); creationDate = laser.get("ImageCaputreDate"); if (creationDate == null) { creationDate = laser.get("ImageCaptureDate"); while (guiChannel != null) { ChannelData channel = new ChannelData();
private void putTableName(IniTable table, IFormatReader reader, String suffix) { Location file = new Location(reader.getCurrentFile()); table.put(IniTable.HEADER_KEY, file.getName() + suffix); }
private IniList getIniFile(String filename) throws FormatException, IOException { LOGGER.debug("getIniFile procession: {}", filename); RandomAccessInputStream stream = getFile(filename); String data = stream.readString((int) stream.length()); if (!data.startsWith("[")) { data = data.substring(data.indexOf('['), data.length()); } data = DataTools.stripString(data); BufferedReader reader = new BufferedReader(new StringReader(data)); stream.close(); IniList list = parser.parseINI(reader); // most of the values will be wrapped in double quotes for (IniTable table : list) { LOGGER.debug(""); LOGGER.debug("[" + table.get(IniTable.HEADER_KEY) + "]"); String[] keys = table.keySet().toArray(new String[table.size()]); for (String key : keys) { String value = sanitizeValue(table.get(key)); LOGGER.debug(key + " = " + value); table.put(key, value); } } reader.close(); return list; }
String[] saveKeys = saveInfo.keySet().toArray(new String[saveInfo.size()]); for (String key : saveKeys) { String value = saveInfo.get(key).toString(); value = sanitizeValue(value).trim(); code[i] = commonParams.get("AxisCode"); size[i] = commonParams.get("MaxSize"); double end = Double.parseDouble(commonParams.get("EndPosition")); double start = Double.parseDouble(commonParams.get("StartPosition")); pixelSize[i] = end - start; imageDepth = Integer.parseInt(referenceParams.get("ImageDepth")); pixelSizeX = referenceParams.get("WidthConvertValue"); pixelSizeY = referenceParams.get("HeightConvertValue"); String ripValidBitCounts = referenceParams.get("ValidBitCounts"); if (ripValidBitCounts != null) { validBits = Integer.parseInt(ripValidBitCounts); laserEnabled = laser.get("Laser Enable").equals("1"); if (laserEnabled) { wavelengths.add(new Double(laser.get("LaserWavelength"))); creationDate = laser.get("ImageCaputreDate"); if (creationDate == null) { creationDate = laser.get("ImageCaptureDate"); while (guiChannel != null) { ChannelData channel = new ChannelData();
public String getImageDescription() { return currentTable.get(DESCRIPTION); }
/** * Flattens all of the INI tables into a single HashMap whose keys are * of the format "[table name] table key". * * @return a HashMap containing all key/value pairs in every {@link IniTable} * as described above */ public HashMap<String, String> flattenIntoHashMap() { HashMap<String, String> h = new HashMap<String, String>(); for (IniTable table : this) { String tableName = table.get(IniTable.HEADER_KEY); for (String key : table.keySet()) { if (!key.equals(IniTable.HEADER_KEY)) { h.put("[" + tableName + "] " + key, table.get(key)); } } } return h; }
IniTable globalTable = new IniTable(); putTableName(globalTable, reader, " global"); globalTable.put(SERIES_COUNT, String.valueOf(seriesCount)); globalTable.put(READER, TestTools.shortClassName(r)); globalTable.put(TEST, "true"); globalTable.put(MEMORY, String.valueOf(TestTools.getUsedMemory())); globalTable.put(ACCESS_TIME, String.valueOf(t1 - t0)); IniTable seriesTable = new IniTable(); putTableName(seriesTable, unflattenedReader, SERIES + series + " " + RESOLUTION + resolution); seriesTable.put(RESOLUTION_COUNT, String.valueOf(resolutionCount)); seriesTable.put(SIZE_X, String.valueOf(reader.getSizeX())); seriesTable.put(SIZE_Y, String.valueOf(reader.getSizeY())); seriesTable.put(SIZE_Z, String.valueOf(reader.getSizeZ())); seriesTable.put(SIZE_C, String.valueOf(reader.getSizeC())); seriesTable.put(SIZE_T, String.valueOf(reader.getSizeT())); seriesTable.put(DIMENSION_ORDER, reader.getDimensionOrder()); seriesTable.put(IS_INTERLEAVED, String.valueOf(reader.isInterleaved())); seriesTable.put(IS_INDEXED, String.valueOf(reader.isIndexed())); seriesTable.put(IS_FALSE_COLOR, String.valueOf(reader.isFalseColor())); seriesTable.put(IS_RGB, String.valueOf(reader.isRGB())); seriesTable.put(THUMB_SIZE_X, String.valueOf(reader.getThumbSizeX())); seriesTable.put(THUMB_SIZE_Y, String.valueOf(reader.getThumbSizeY())); seriesTable.put(PIXEL_TYPE,
public boolean hasImageDescription() { return currentTable.containsKey(DESCRIPTION); }
public String getDimensionOrder() { return currentTable.get(DIMENSION_ORDER); }
/** Saves the given IniList to the given file. */ public void saveINI(IniList ini, String path, boolean append, boolean sorted) throws IOException { BufferedWriter out = new BufferedWriter(new OutputStreamWriter( new FileOutputStream(path, append), Constants.ENCODING)); for (IniTable table : ini) { String header = table.get(IniTable.HEADER_KEY); out.write("[" + header + "]\n"); Set<String> keys; if (sorted) { Map<String, String> treeMap = new TreeMap<String, String>(table); keys = treeMap.keySet(); } else { keys = table.keySet(); } for (String key : keys) { out.write(key + " = " + table.get(key) + "\n"); } out.write("\n"); } out.close(); }
public String getPixelType() { return currentTable.get(PIXEL_TYPE); }