Skip to content

Usage examples

John Bogovic edited this page Feb 13, 2019 · 30 revisions

Prerequisites

  1. Install this repository's code into your Fiji
  2. Install the image transformer script into your Fiji
  3. Download the following for these examples:
  1. Unzip the bridging transformation files, and convert the affine part to a text file with ANTs:
ConvertTransformFile 3 JRC2018F_JFRC2010_GenericAffine.mat JRC2018F_JFRC2010_Affine.mat --hm

Transforming images

We recommend using the transformImage shell script for transforming images.

Usage: transformImage [-v] [--interpolation=<interpolation>] [-j=<nThreads>]
                    [-s=<outputSize>] -i=<inputFiles> [-i=<inputFiles>]...
                    -o=<outputFiles> [-o=<outputFiles>]...
                    [-r=<outputResolution>[,<outputResolution>...]]...
                    [-t=<transformFiles>]...
      --interpolation=<interpolation>
                             Interpolation {LINEAR, NEAREST, LANCZOS}
  -i, --input=<inputFiles>   Image file to transform
  -j, --nThreads=<nThreads>  Number of rendering threads (default=1)
  -o, --output=<outputFiles> Output file for transformed image
  -r, --output-resolution=<outputResolution>[,<outputResolution>...]
                             The resolution at which to write the output
  -s, --outputImageSize=<outputSize>
                             Size of image output in pixels
  -t, --transform=<transformFiles>
                             Transformation file.
  -v, --version              Prints version information and exits.

Transforming skeletons

We recommend using the transformSwc shell script or the transform_swc fiji script.

Shell script options

You can see a summary of the options by running

$ transformSwc --help
Usage: input parser [options]
  Options:
    -d, --directory
       Directory containing skeletons
    --exclude
       Exclusion pattern: Files matching the given regular expression will be
       ignored. Only relevant when pass a directory
    -h, --help
       Print this help message
       Default: false
    --include
       Matching pattern: Files not matching the given regular expression will be
       ignored.  Only relevant when passing a directory
    -o, --output
       Output skeleton file names. Must have one output for every input
       skeleton, and pass outputfile paths in the same order as the input sketons.
    -s, --skeleton
       Input skeletons. Can pass multiple skeletons
    --suffix
       Suffix applied to output files when passing a directory.
       Default: _transformed
    -t, --transform
       Transforms
Basic usage

Transform an skeleton and write it to an output file

transformSwc -s <swc skeleton file> -o <output file> -t <transform file>

Transform multiple skeletons with the same transforms:

transformSwc \
   -s <swc skeleton file 1> -o <output file 1> \ 
   -s <swc skeleton file 2> -o <output file 2> \
   -t <transform file>

Transform a skeleton with a sequence of transforms (some inverted). In this example the inverse of the third transform is applied:

transformSwc \
   -s <swc skeleton file> -o <output file> \ 
   -t <transform file 1> -t <transform file 2> -t inverse <transform file 3>
Clone this wiki locally