Image QA - Read image (RAW/NonRAW)
Created: 2012-02-27 15:54:18
Last updated: 2012-02-27 15:54:19
Reads an image for evaluation. How the file is read depends on the image type (RAW, NonRAW) of the current image and the image to compare with.
Preview
Run
Run this Workflow in the Taverna Workbench...
Workflow Components
Authors (1)
Titles (1)
Image QA - Read image (RAW/NonRAW) |
Descriptions (1)
Reads an image for evaluation. How the file is read depends on the image type (RAW, NonRAW) of the current image and the image to compare with. |
Dependencies (0)
Inputs (3)
Name |
Description |
path |
Path to the image to read.
|
isRawThis |
Whether the path points to a raw image.
|
isRawOther |
Whether the other image for comparison is a raw image.
|
Processors (9)
Name |
Type |
Description |
selectDcrawParameters |
beanshell |
ScriptArrayList dcraw_noInt_noConv_fixed_path = new ArrayList(1);
ArrayList dcraw_srgb_colorInt_fixed_path = new ArrayList(1);
ArrayList dcraw_srgb_colorInt_camera_path = new ArrayList(1);
ArrayList nonraw = new ArrayList(1);
boolean isRawThisBool = "true".equals(isRawThis);
boolean isRawOtherBool = "true".equals(isRawOther);
if (isRawThisBool && isRawOtherBool) {
dcraw_noInt_noConv_fixed_path.add(path);
dcraw_srgb_colorInt_fixed_path.add(path);
} else {
if (isRawThisBool) {
dcraw_srgb_colorInt_camera_path.add(path);
} else {
nonraw.add(path);
}
} |
readNoIntNoConvFixed |
workflow |
|
readSrgbColorIntCamera |
workflow |
|
readSrgbColorIntFixed |
workflow |
|
readFile |
beanshell |
ScriptFile file = new File(path);
InputStream is = new FileInputStream(file);
// Get the size of the file
long length = file.length();
// Create the byte array to hold the data
byte[] image = new byte[(int)length];
// Read in the bytes
int offset = 0;
int numRead = 0;
while (offset < image.length && (numRead=is.read(image, offset, image.length-offset)) >= 0) {
offset += numRead;
}
// Ensure all the bytes have been read in
if (offset < image.length) {
throw new IOException("Could not completely read file "+file.getName());
}
// Close the input stream and return bytes
is.close(); |
getFirstElementDfs |
workflow |
|
selectImageDataEquals |
beanshell |
Script// imageRaw must be a Collection that is either empty or with one element
if (imageRaw instanceof Collection) {
if (imageRaw.size() == 1) {
// imageRaw has a value, use it
imageEquals = imageRaw.get(0);
} else {
// dcraw_noInt_noConv_fixed was not filled, use others
imageEquals = imageOthers;
}
} else {
throw new Excpetion("Error reading image with dcraw workflow");
} |
profileStart |
beanshell |
Scriptimport org.apache.log4j.Logger;
Logger logger = Logger.getLogger("Workflow - Read image (RAW, NonRAW)");
logger.info("Reading image");
long startTimestamp = System.nanoTime(); |
profileEnd |
beanshell |
Scriptimport org.apache.log4j.Logger;
Logger logger = Logger.getLogger("Workflow - Read image (RAW, NonRAW)");
logger.info("Done reading image");
long startTimestampLong = Long.parseLong(startTimestamp);
double runtime = (System.nanoTime() - startTimestampLong) * 1.0e-9; |
Beanshells (6)
Name |
Description |
Inputs |
Outputs |
selectDcrawParameters |
|
path
isRawThis
isRawOther
|
dcraw_noInt_noConv_fixed_path
dcraw_srgb_colorInt_camera_path
dcraw_srgb_colorInt_fixed_path
nonraw
|
readFile |
|
path
|
image
|
selectImageDataEquals |
|
imageRaw
imageOthers
|
imageEquals
|
profileStart |
|
|
startTimestamp
|
profileEnd |
|
startTimestamp
|
runtime
|
getFirstElementDFS |
|
input
|
firstElement
|
Outputs (3)
Name |
Description |
imageEquals |
Image for equals comparison as byte array.
|
imageOthers |
Image for other comparisons as byte array.
|
runtime |
|
Datalinks (16)
Source |
Sink |
path |
selectDcrawParameters:path |
isRawThis |
selectDcrawParameters:isRawThis |
isRawOther |
selectDcrawParameters:isRawOther |
selectDcrawParameters:dcraw_noInt_noConv_fixed_path |
readNoIntNoConvFixed:path |
selectDcrawParameters:dcraw_srgb_colorInt_camera_path |
readSrgbColorIntCamera:path |
selectDcrawParameters:dcraw_srgb_colorInt_fixed_path |
readSrgbColorIntFixed:path |
selectDcrawParameters:nonraw |
readFile:path |
readNoIntNoConvFixed:image |
selectImageDataEquals:imageRaw |
getFirstElementDfs:firstElement |
selectImageDataEquals:imageOthers |
profileStart:startTimestamp |
profileEnd:startTimestamp |
readSrgbColorIntCamera:image |
getFirstElementDfs:input |
readSrgbColorIntFixed:image |
getFirstElementDfs:input |
readFile:image |
getFirstElementDfs:input |
selectImageDataEquals:imageEquals |
imageEquals |
getFirstElementDfs:firstElement |
imageOthers |
profileEnd:runtime |
runtime |
Coordinations (4)
Controller |
Target |
profileStart |
selectDcrawParameters |
readSrgbColorIntFixed |
readSrgbColorIntCamera |
selectImageDataEquals |
profileEnd |
readSrgbColorIntCamera |
readNoIntNoConvFixed |
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 (0)
None
Featured In Packs (1)
Log in to add to one of your Packs
Attributed By (0)
(Workflows/Files)
None
Favourited By (0)
No one
Statistics
Other workflows that use similar services
(0)
There are no workflows in myExperiment that use similar services to this Workflow.
Comments (0)
No comments yet
Log in to make a comment