image.lsm -> image_01.nrrd image_02.nrrd image_03.nrrd

convertlsmstonrrd(
  lsmstoconvert,
  rawnrrdsdir,
  ChannelOrder = c(2, 1, 3, 4),
  RandomOrder = TRUE,
  DryRun = TRUE,
  Verbose = !DryRun,
  ...
)

Arguments

lsmstoconvert

Paths to one or more LSMs or a single directory containing LSMs

rawnrrdsdir

Output directory in which to save nrrds

ChannelOrder

The order in which channels of each individual image are saved (defaults to swapping the order of first 2 channels - see details).

RandomOrder

Scramble processing order of files (default TRUE)

DryRun

Show what would happen but don't run (default TRUE)

Verbose

Show filename (default !DryRun)

...

Additional arguments passed to runFijiMacro

Value

Named logical vector indicating whether action was required for each file

Details

ChannelOrder specifies the output stem of the channels in the input image. Thus c(2,3,1) would imply:

image.lsm[1:3] -> image_02.nrrd image_03.nrrd image_01.nrrd

lsmstoconvert uses Fiji and lsmtonrrd macro, which in turn relies on LOCI Bio-Formats which cannot currently be run headless.

Uses RunCmdForNewerInput to compare in/outputs to see if action required. Uses file locking so can be run in parallel, although IO intensive so running too many jobs in parallel would be counter-productive. RandomOrder=TRUE reduces file locking pressure when several processes compete to lock the same file.

See also

runFijiMacro, RunCmdForNewerInput

Examples

if (FALSE) { convertlsmstonrrd("my.lsm", ChannelOrder=1:3, DryRun=FALSE) } # Path to the Fiji macro distributed with the package system.file('ijm','lsmtonrrd.txt', package = 'jimpipeline')
#> [1] "/home/travis/R/Library/jimpipeline/ijm/lsmtonrrd.txt"