Scansplit

Program to split large scan into individual micrographs. The location of individual micrographs is determined by a dummy micrograph reference.

tree

tree

Input: Micrographs

Output: Output micrograph pattern

Parameters

Parameter

Example (default)

Description

Micrographs

cs_scan034.tif

Input micrographs: accepted file formats (tif, .mrc, .mrcs, .spi, .hdf, .img, .hed).

Output micrograph pattern

cs_scan034???.mrc

If single input micrograph: name of pattern. In case of multiple micrographs suffix to be attached to corresponding micrograph. Use wildcards cs_scan034???.mrc OR cs_scan034*.mrc, accepted file formats (jpg, .tif, .mrc, .spi, .hdf, .img, .hed).

Number of columns x rows

(3, 2)

Integer value for number of columns x rows of micrographs located on scan (accepted values min=1, max=10).

Number of micrographs to be cropped

6

Integer value number of micrographs located on scan (number of rows x number of columns) (accepted values min=1, max=100).

Sample parameter file

You may run the program in the command line by providing the parameters via a text file:

scansplit --f parameterfile.txt

Where the format of the parameters is:

Micrographs                              = cs_scan034.tif
Output micrograph pattern                = cs_scan034???.mrc
Number of columns x rows                 = (3, 2)
Number of micrographs to be cropped      = 6

Additional parameters (intermediate level)

Parameter

Example (default)

Description

Micrograph width x height in cm

(8.0, 9.0)

Width x height dimension of micrograph in cm (accepted values min=0, max=50).

Scanner step size in micrometer

7.0

Characteristic resolution or step size of scanner in micrometer (accepted values min=1, max=1000).

Contact print option

False

Option to produce a contact print of the entire scan.

Final print option

False

Option to produce a final high-contrast print of the cropped micrograph.

Normscan option

False

Option to normalize micrograph columns to eliminate steep grey-value differences in micrograph columns that can be present in Zeiss scans.

Binning option

False

Micrograph is reduced in size by binning.

Binning factor

6

Micrograph is reduced in size by binning factor (accepted values min=1, max=20).

MPI option

True

OpenMPI installed (mpirun).

Number of CPUs

2

Number of processors to be used. Maximum number corresponds directly to number of input scans, i.e. no gain in performance if single input micrograph chosen (accepted values min=1, max=300).

Temporary directory

/tmp

Temporary directory should have fast read and write access.

Sample parameter file (intermediate level)

You may run the program in the command line by providing the parameters via a text file:

scansplit --f parameterfile.txt

Where the format of the parameters is:

Micrographs                              = cs_scan034.tif
Output micrograph pattern                = cs_scan034???.mrc
Number of columns x rows                 = (3, 2)
Number of micrographs to be cropped      = 6
Micrograph width x height in cm          = (8.0, 9.0)
Scanner step size in micrometer          = 7.0
Contact print option                     = False
Final print option                       = False
Normscan option                          = False
Binning option                           = False
Binning factor                           = 6
MPI option                               = True
Number of CPUs                           = 2
Temporary directory                      = /tmp

Additional parameters (expert level)

Parameter

Example (default)

Description

Label width x height in cm

(2.7, 1.4)

Width x height dimension of black label in cm located at bottom of micrograph (accepted values min=0, max=10).

Cross-correlation rejection criterion

10000.0

Use the default number to exclude empty positions with no micrograph on scan - otherwise use with caution (accepted values min=0, max=1e+08).

Sample parameter file (expert level)

You may run the program in the command line by providing the parameters via a text file:

scansplit --f parameterfile.txt

Where the format of the parameters is:

Micrographs                              = cs_scan034.tif
Output micrograph pattern                = cs_scan034???.mrc
Number of columns x rows                 = (3, 2)
Number of micrographs to be cropped      = 6
Micrograph width x height in cm          = (8.0, 9.0)
Label width x height in cm               = (2.7, 1.4)
Scanner step size in micrometer          = 7.0
Cross-correlation rejection criterion    = 10000.0
Contact print option                     = False
Final print option                       = False
Normscan option                          = False
Binning option                           = False
Binning factor                           = 6
MPI option                               = True
Number of CPUs                           = 2
Temporary directory                      = /tmp

Command line options

When invoking scansplit, you may specify any of these options:

usage: scansplit [-h] [--g] [--p] [--f FILENAME] [--c] [--l LOGFILENAME] [--d DIRECTORY_NAME] [--version] [--contact_print_option]
                 [--final_print_option] [--normscan_option] [--binning_option] [--mpi_option]
                 [input_output [input_output ...]]

Program to split large scan into individual micrographs. The location of individual micrographs is determined by a dummy micrograph reference.

positional arguments:
  input_output          Input and output files

optional arguments:
  -h, --help            show this help message and exit
  --g, --GUI            GUI option: read input parameters from GUI
  --p, --promptuser     Prompt user option: read input parameters from prompt
  --f FILENAME, --parameterfile FILENAME
                        File option: read input parameters from FILENAME
  --c, --cmd            Command line parameter option: read only boolean input parameters from command line and all other parameters will be assigned
                        from other sources
  --l LOGFILENAME, --logfile LOGFILENAME
                        Output logfile name as specified
  --d DIRECTORY_NAME, --directory DIRECTORY_NAME
                        Output directory name as specified
  --version             show program's version number and exit
  --contact_print_option, --con
                        Option to produce a contact print of the entire scan. (default: False)
  --final_print_option, --fin
                        Option to produce a final high-contrast print of the cropped micrograph. (default: False)
  --normscan_option, --nor
                        Option to normalize micrograph columns to eliminate steep grey-value differences in micrograph columns that can be present in
                        Zeiss scans. (default: False)
  --binning_option, --bin
                        Micrograph is reduced in size by binning. (default: False)
  --mpi_option, --mpi   OpenMPI installed (mpirun). (default: False)

Program flow

  1. readmic: Read input micrograph

  2. roughsplit: Rough splitting of micrograph according to number of rows and columns

  3. make_refmic: Make binary reference micrograph including label

  4. findlabel: Find label on micrograph with respect to reference micrograph

  5. finesplit: Fine splitting of micrograph according to matched position

  6. normscan: Normalize micrograph columns using Niko Grigorieff’s Normscan

  7. bin_micrographs: Bin micrographs by specified factor

  8. contactprint: Produce contact print of scan

  9. finalprint: Produce final prints of split micrograph