Difference between revisions of "ViSUS Convert"
(→Tiled dataset) |
|||
Line 45: | Line 45: | ||
=== Tiled dataset === | === Tiled dataset === | ||
− | Multiple images can be combined (as tiles) to compose a panorama or volume (e.g. stack of | + | Multiple images can be combined (as tiles) to compose a panorama or volume (e.g. stack of images from an MRI scan). |
This can be easily performed specifying the destination ''box'' of each image, as following: | This can be easily performed specifying the destination ''box'' of each image, as following: |
Revision as of 21:43, 31 July 2017
Contents
Introduction
ViSUS convert is the tool that allows to convert data from different file formats (i.e. mainly image formats and raw) to IDX.
The supported formats are the ones supported by FreeImage.
In the following examples we will use the variable $CONVERT
as the visus convert executable.
You can set this variable using your OS commands like:
export CONVERT=/path/to/visus_executable
or
setenv CONVERT /path/to/visus_executable
The variable $RESOURCES
is used instead to indicate a folder that contains the data to convert.
Some useful definitions:
- a box defines the extent of the domain where the samples are placed for each dimension
- the dims are the number of samples for each dimension
- the dtype (i.e. datatype) is defined as a combination of the number type and the number of components (e.g. int8 with 3 components will be
int8[3]
, for single component a simpleint8
can be used)
Examples
Simple conversion
For very simple conversions, all you need is:
$CONVERT import $RESOURCES/cat_gray.tga create temp/cat_gray.idx
Get information
To *get information* about any file (including non-idx), use info
$CONVERT info $RESOURCES/cat_gray.tga $CONVERT info $RESOURCES/cat_rgb.tga $CONVERT info temp/cat_gray.idx $CONVERT info temp/cat_rgb.idx
Create the IDX dataset
To explicitly create the idx volume
You can define a set of fields:
fields="scalar uint8 compressed + vector uint8[3] compressed"
and use the following to create the dataset
$CONVERT create temp/test_formats.idx --box "0 511 0 511" --fields "$fields"
Tiled dataset
Multiple images can be combined (as tiles) to compose a panorama or volume (e.g. stack of images from an MRI scan).
This can be easily performed specifying the destination box of each image, as following:
$CONVERT import $RESOURCES/cat_gray.tga export temp/test_formats.idx --field scalar --box " 0 255 0 255" $CONVERT import $RESOURCES/cat_gray.tga export temp/test_formats.idx --field scalar --box "256 511 0 255" $CONVERT import $RESOURCES/cat_gray.tga export temp/test_formats.idx --field scalar --box " 0 255 256 511" $CONVERT import $RESOURCES/cat_gray.tga export temp/test_formats.idx --field scalar --box "256 511 256 511"
Conversion from image to IDX
Conversion from IDX to image formats can be performed as well using the same technique, as following:
$CONVERT import temp/test_formats.idx --field scalar --box " 0 255 0 255" export temp/test_formats_scalar.tga $CONVERT import temp/test_formats.idx --field scalar --box "256 511 0 255" export temp/test_formats_scalar.jpg $CONVERT import temp/test_formats.idx --field scalar --box " 0 255 256 511" export temp/test_formats_scalar.tif $CONVERT import temp/test_formats.idx --field scalar --box "256 511 256 511" export temp/test_formats_scalar.bmp $CONVERT import temp/test_formats.idx --field scalar --box "128 383 128 383" export temp/test_formats_scalar.png