TIF to JP2 file format migration with quality assurance
Created: 2014-05-07 13:59:26
Last updated: 2014-05-07 13:59:27
This workflow reads a textfile containing absolute paths to TIF image files and converts them to JP2 image files using OpenJPEG (https://code.google.com/p/openjpeg).
Based on the input text file, the workflow creates a Taverna list to be processed file by file. A temporary directory is created (createtmpdir) where the migrated image files and some temporary tool outputs are stored.
Before starting the actual migration, it is checked if the TIF input images are valid file format instances using Fits (https://code.google.com/p/fits, JHove2 under the hood, http://www.jhove2.org). An XPath service is used to extract the validity information from the XML-based Fits validation report.
If the images are valid TIF images, they are migrated to the JPEG2000 (JP2) image file format using OpenJPEG 2.0 (opj_compress).
Subsequently, it is again checked if the migrated images are valid JP2 images using SCAPE tool Jpylyzer (http://www.openplanetsfoundation.org/software/jpylyzer). An XPath service (XPathJpylyzer) is used to extract the validity information from the XML-based Jpylyzer validation report.
Finally, we verify if the migrated JP2 images are valid surrogates of the original TIF images by restoring the original TIF image from the converted JP2 image and comparing whether original and restored images are identical .
Preview
Run
Run this Workflow in the Taverna Workbench...
Workflow Components
Authors (1)
|  |
Titles (1)
|  |
TIF to JP2 file format migration with quality assurance |
Descriptions (1)
|  |
This workflow reads a textfile containing absolute paths to TIF image files and converts them to JP2 image files using OpenJPEG (https://code.google.com/p/openjpeg).
Based on the input text file, the workflow creates a Taverna list to be processed file by file. A temporary directory is created (createtmpdir) where the migrated image files and some temporary tool outputs are stored.
Before starting the actual migration, it is checked if the TIF input images are valid file format instances using Fits (https://code.google.com/p/fits, JHove2 under the hood, http://www.jhove2.org). An XPath service is used to extract the validity information from the XML-based Fits validation report.
If the images are valid TIF images, they are migrated to the JPEG2000 (JP2) image file format using OpenJPEG 2.0 (opj_compress).
Subsequently, it is again checked if the migrated images are valid JP2 images using SCAPE tool Jpylyzer (http://www.openplanetsfoundation.org/software/jpylyzer). An XPath service (XPathJpylyzer) is used to extract the validity information from the XML-based Jpylyzer validation report.
Finally, we verify if the migrated JP2 images are valid surrogates of the original TIF images by restoring the original TIF image from the converted JP2 image and comparing whether original and restored images are identical . |
Dependencies (0)
|  |
Inputs (1)
|  |
Name |
Description |
input_dir |
Input directory containing TIFF image files
|
Processors (13)
|  |
Name |
Type |
Description |
Text2List |
localworker |
ScriptList split = new ArrayList();
if (!string.equals("")) {
String regexString = ",";
if (regex != void) {
regexString = regex;
}
String[] result = string.split(regexString);
for (int i = 0; i < result.length; i++) {
String r = result[i];
r = r.replaceAll("\\s+$", "");
split.add(r);
}
}
|
regex |
stringconstant |
Value\n |
fitsValidation |
externaltool |
|
XPathJhove2 |
xpath |
Xpath Expression/default:fits/default:filestatus/default:valid//text() |
FlattenJhove2List |
localworker |
Scriptflatten(inputs, outputs, depth) {
for (i = inputs.iterator(); i.hasNext();) {
element = i.next();
if (element instanceof Collection && depth > 0) {
flatten(element, outputs, depth - 1);
} else {
outputs.add(element);
}
}
}
outputlist = new ArrayList();
flatten(inputlist, outputlist, 1); |
opj_compress |
externaltool |
|
createtmpdir |
externaltool |
|
jpylyzerValidation |
externaltool |
|
XPathJpylyzer |
xpath |
Xpath Expression/jpylyzer/isValidJP2/text() |
FlattenJpylyzerList |
localworker |
Scriptflatten(inputs, outputs, depth) {
for (i = inputs.iterator(); i.hasNext();) {
element = i.next();
if (element instanceof Collection && depth > 0) {
flatten(element, outputs, depth - 1);
} else {
outputs.add(element);
}
}
}
outputlist = new ArrayList();
flatten(inputlist, outputlist, 1); |
opj_decompress |
externaltool |
|
compare |
externaltool |
|
image_paths_from_dir |
externaltool |
|
Beanshells (0)
|  |
Outputs (2)
|  |
Datalinks (19)
|  |
Source |
Sink |
regex:value |
Text2List:regex |
image_paths_from_dir:STDOUT |
Text2List:string |
Text2List:split |
fitsValidation:tiffimagepath |
fitsValidation:STDOUT |
XPathJhove2:xml_text |
XPathJhove2:nodelist |
FlattenJhove2List:inputlist |
FlattenJhove2List:outputlist |
opj_compress:isvalidtif |
Text2List:split |
opj_compress:tifinfilepath |
createtmpdir:STDOUT |
opj_compress:tmpdir |
opj_compress:STDOUT |
jpylyzerValidation:inFileAbsPath |
jpylyzerValidation:STDOUT |
XPathJpylyzer:xml_text |
XPathJpylyzer:nodelist |
FlattenJpylyzerList:inputlist |
createtmpdir:STDOUT |
opj_decompress:tmpdir |
FlattenJpylyzerList:outputlist |
opj_decompress:isvalidjp2 |
opj_compress:STDOUT |
opj_decompress:jp2infilepath |
Text2List:split |
compare:origtifinfilepath |
opj_decompress:STDOUT |
compare:targettifinfilepath |
input_dir |
image_paths_from_dir:input_directory |
compare:STDOUT |
out |
compare:STDERR |
err |
Coordinations (0)
|  |
Uploader
License
All versions of this Workflow are
licensed under:
Version 1
(of 1)
Credits (1)
(People/Groups)
Attributions (0)
(Workflows/Files)
None
Shared with Groups (1)
Featured In Packs (0)
None
Log in to add to one of your Packs
Attributed By (0)
(Workflows/Files)
None
Favourited By (0)
No one
Statistics
Citations (0)Version History
Other workflows that use similar services
(0)
There are no workflows in myExperiment that use similar services to this Workflow.
No comments yet
Log in to make a comment