2022-07-12 09:40:35 +09:00
|
|
|
# BioFormatsImageInfo
|
2023-07-13 13:50:25 +09:00
|
|
|
|
2022-07-12 09:40:35 +09:00
|
|
|
Metadata extraction tool based on Bio-Formats
|
|
|
|
|
2023-08-22 14:05:18 +09:00
|
|
|
## make package
|
2023-07-13 13:50:25 +09:00
|
|
|
|
2022-07-12 09:40:35 +09:00
|
|
|
```shell
|
2022-07-12 17:46:31 +09:00
|
|
|
mvn package
|
2022-07-12 09:40:35 +09:00
|
|
|
```
|
|
|
|
|
2023-08-22 14:05:18 +09:00
|
|
|
## run
|
2023-07-13 13:50:25 +09:00
|
|
|
|
2022-07-12 09:40:35 +09:00
|
|
|
```shell
|
2024-11-01 10:23:42 +09:00
|
|
|
./target/dist/bin/bioformats-imageinfo "[OPTION]" "[path to image file]"
|
2022-07-12 09:40:35 +09:00
|
|
|
```
|
|
|
|
|
2022-07-12 17:46:31 +09:00
|
|
|
### run by jar
|
2023-07-13 13:50:25 +09:00
|
|
|
|
2022-07-12 09:40:35 +09:00
|
|
|
```shell
|
2024-11-05 18:55:31 +09:00
|
|
|
java -jar ./target/dist/lib/bioformats-imageinfo-1.2.4.jar "[OPTION]" "[path to image file]"
|
2022-07-12 09:40:35 +09:00
|
|
|
```
|
|
|
|
|
2022-07-12 17:46:31 +09:00
|
|
|
### run by fat jar
|
2023-07-13 13:50:25 +09:00
|
|
|
|
2022-07-12 09:40:35 +09:00
|
|
|
```shell
|
2024-11-05 18:55:31 +09:00
|
|
|
java -jar ./target/bioformats-imageinfo-1.2.4-jar-with-dependencies.jar "[OPTION]" "[path to image file]"
|
2024-11-01 10:23:42 +09:00
|
|
|
```
|
|
|
|
|
|
|
|
### OPTION
|
|
|
|
|
|
|
|
```shell
|
|
|
|
-M output metadata
|
|
|
|
-T output thumbnail
|
2022-07-12 09:40:35 +09:00
|
|
|
```
|
|
|
|
|
2023-08-22 14:05:18 +09:00
|
|
|
## library usage
|
2023-07-13 13:50:25 +09:00
|
|
|
|
2022-07-12 09:40:35 +09:00
|
|
|
```java
|
|
|
|
import java.util.LinkedHashMap;
|
|
|
|
import java.util.Map;
|
|
|
|
import jp.riken.neurodata.tools.BioFormatsImageInfo;
|
2022-09-29 19:03:57 +09:00
|
|
|
import jp.riken.neurodata.tools.BioFormatsImageException;
|
|
|
|
import jp.riken.neurodata.tools.BioFormatsImageThumbnail;
|
2022-07-12 09:40:35 +09:00
|
|
|
|
|
|
|
String path = "[path to image file]";
|
|
|
|
String format = "";
|
|
|
|
Map<String, Object> metadata = new LinkedHashMap<String, Object>();
|
2022-09-29 19:03:57 +09:00
|
|
|
Map<String, Object> thumbnail = new LinkedHashMap<String, Object>();
|
2022-07-12 09:40:35 +09:00
|
|
|
|
|
|
|
try {
|
2022-07-12 09:53:08 +09:00
|
|
|
format = BioFormatsImageInfo.readMetadata(path, metadata);
|
2022-09-29 19:03:57 +09:00
|
|
|
BioFormatsImageThumbnail.readThumbnail(path, thumbnail);
|
2022-07-12 09:40:35 +09:00
|
|
|
} catch (BioFormatsImageException e) {
|
2022-07-12 09:53:08 +09:00
|
|
|
// error occurred
|
2022-07-12 09:40:35 +09:00
|
|
|
e.printStackTrace();
|
|
|
|
}
|
|
|
|
```
|