convertlsmstonrrd: Split Zeiss LSMs and save each channel to a nrrd

Description Usage Arguments Details Value See Also Examples

View source: R/lsm_convert.R

Description

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

Usage

1
2
3
4
5
6
7
8
9
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

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.

Value

Named logical vector indicating whether action was required for each file

See Also

runFijiMacro, RunCmdForNewerInput

Examples

1
2
3
4
5
6
7
## Not run: 
convertlsmstonrrd("my.lsm", ChannelOrder=1:3, DryRun=FALSE)

## End(Not run)

# Path to the Fiji macro distributed with the package
system.file('ijm','lsmtonrrd.txt', package = 'jimpipeline')

jefferislab/jimpipeline documentation built on Sept. 14, 2020, 3:41 p.m.