nornir_buildmanager

Core package exports, CLI wiring, and pipeline execution helpers.

Note: Certain arguments support regular expressions. See the python re module for instructions on how to construct appropriate regular expressions.

Options available to all build commands. Specific pipelines extend this argument list.

usage: nornir_build volumepath [-h] [-debug] [-lowpriority] [-verbose]
                               [-computational_library {cupy,numpy,detect}]
                               [-no-delete]
                               {help,RecoverLinks,RecoverNotes,RepairXML,AddStos,AddToStosMap,AdjustContrast,AdoptVikingVolume,AlignSections,Assemble,AssembleStosOverlays,AssembleTiles,AssembleTilesFromImage,BuildImagePyramids,CalculateStosGroupWarpMetrics,Cleanup,CleanupStos,CopyStosGroup,CreateBlobFilter,CreateStosGroup,CreateVikingXML,ExportAnnotationCrops,ExportImages,ExportMetadata,ForceUpdateInputTransform,GenerateMosaicLayoutSVG,Histogram,ImportDM4,ImportIDoc,ImportImages,ImportMRC,ImportPMG,InvertFilter,LinearizeVolume,ListBlockStosMaps,ListDamagedSections,ListFilterContrast,ListGroupSectionMappings,ListMissingTilesets,ListPruneCutoff,ListStosGroups,ListStosMap,MarkSectionsDamaged,MarkSectionsUndamaged,Mosaic,MosaicNoTranslate,MosaicReport,MosaicToVolume,PrintContrast,Prune,RefineSectionAlignment,RefineSectionAlignment-IrTools,RemoveFromStosMap,RemoveStosGroup,RemoveTransform,RenameFilter,RepairAnnotationOverlays,RepairStosAngles,ReportVolumeBounds,ScaleVolumeTransforms,ScoreAnnotationCrops,ScoreStosGroupQuality,SelectBestRegistrationChain,SetContrast,SetFilterLock,SetFilterMaskName,SetMosaicLock,SetPruneCutoff,SetTransformLock,ShadeCorrect,SliceToVolume,StosReport,SyncValidationTimes,VolumeImage} ...

Named Arguments

-debug

If true any exceptions raised by pipelines are not handled.

Default: False

-lowpriority, -lp

Run the build with lower priority. The machine may be more responsive at the expense of much slower builds. 3x-5x slower in tests.

Default: False

-verbose

Log per-iterate pipeline progress (Iterate/Mapping dumps). Same as NORNIR_LOG_PIPELINE_PROGRESS=1. Independent of -debug.

Default: False

-computational_library

Possible choices: cupy, numpy, detect

If not specified, cupy will be used if a nVidia GPU is present. Otherwise, force cupy (GPU) or numpy (CPU) use.

Default: 'detect'

-no-delete

Skip all destructive Clean() and file removals; log what would have been deleted instead. Stages still run and missing outputs are still created.

Default: False

Commands

command

Possible choices: help, RecoverLinks, RecoverNotes, RepairXML, AddStos, AddToStosMap, AdjustContrast, AdoptVikingVolume, AlignSections, Assemble, AssembleStosOverlays, AssembleTiles, AssembleTilesFromImage, BuildImagePyramids, CalculateStosGroupWarpMetrics, Cleanup, CleanupStos, CopyStosGroup, CreateBlobFilter, CreateStosGroup, CreateVikingXML, ExportAnnotationCrops, ExportImages, ExportMetadata, ForceUpdateInputTransform, GenerateMosaicLayoutSVG, Histogram, ImportDM4, ImportIDoc, ImportImages, ImportMRC, ImportPMG, InvertFilter, LinearizeVolume, ListBlockStosMaps, ListDamagedSections, ListFilterContrast, ListGroupSectionMappings, ListMissingTilesets, ListPruneCutoff, ListStosGroups, ListStosMap, MarkSectionsDamaged, MarkSectionsUndamaged, Mosaic, MosaicNoTranslate, MosaicReport, MosaicToVolume, PrintContrast, Prune, RefineSectionAlignment, RefineSectionAlignment-IrTools, RemoveFromStosMap, RemoveStosGroup, RemoveTransform, RenameFilter, RepairAnnotationOverlays, RepairStosAngles, ReportVolumeBounds, ScaleVolumeTransforms, ScoreAnnotationCrops, ScoreStosGroupQuality, SelectBestRegistrationChain, SetContrast, SetFilterLock, SetFilterMaskName, SetMosaicLock, SetPruneCutoff, SetTransformLock, ShadeCorrect, SliceToVolume, StosReport, SyncValidationTimes, VolumeImage

Sub-commands

help

Show help for a specific command

nornir_build volumepath help [-h] [command_name]

Positional Arguments

command_name

Name of the command to show help for

RecoverNotes

Recover or update notes from *.txt files. With ImportDir, scan an IDoc-style raw-data tree and copy changed notes into matching volume sections.

nornir_build volumepath RecoverNotes [-h] [-save] volumepath [ImportDir]

Positional Arguments

volumepath

The path to the volume

ImportDir

Optional raw-data directory in IDoc import layout. When provided, notes.txt files from section folders are copied into matching volume sections.

Named Arguments

-save

Set this flag to save the VolumeData.xml files with the located linked elements included.

Default: False

RepairXML

Fixes an issue where XML files have extra characters after the closing tag. Should only apply to data before Dec 2023

nornir_build volumepath RepairXML [-h] volumepath

Positional Arguments

volumepath

The path to the volume

AddStos

Import a Slice-to-slice transformation to a StosGroup.

nornir_build volumepath AddStos [-h] [-to [TO ...]] [-cc [CC ...]]
                                -File INPUTSTOSFULLPATH [-Block BLOCKNAME]
                                -StosGroup STOSGROUP
                                -ControlSection CONTROLSECTION
                                -ControlChannel CONTROLCHANNEL
                                -ControlFilter CONTROLFILTER
                                -ControlDownsample CONTROLDOWNSAMPLE
                                -MappedSection MAPPEDSECTION
                                -MappedChannel MAPPEDCHANNEL
                                -MappedFilter MAPPEDFILTER
                                -MappedDownsample MAPPEDDOWNSAMPLE -Type TYPE
                                volumepath

Positional Arguments

volumepath

The path to the volume

Named Arguments

-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-File

Path to the .stos file to import

-Block

Block to create the StosGroup within

Default: 'TEM'

-StosGroup

Name of the StosGroup

-ControlSection

Control Section Number of the Stos Transform

-ControlChannel

Control Channel of the Stos Transform

-ControlFilter

Control Filter of image used for transform

-ControlDownsample

Downsample level of controlled section’s image

-MappedSection

Mapped Section Number of the Stos Transform

-MappedChannel

Mapped Channel of the Stos Transform

-MappedFilter

Mapped Filter of image used for transform

-MappedDownsample

Downsample level of mapped section’s image

-Type

Name of the StosGroup

AddToStosMap

List all SliceToSlice mappings within a stos map

nornir_build volumepath AddToStosMap [-h] [-to [TO ...]] [-cc [CC ...]]
                                     [-Block BLOCKNAME] -Name STOSMAPNAME
                                     -ControlSection CONTROLSECTION
                                     -MappedSection MAPPEDSECTION
                                     volumepath

Positional Arguments

volumepath

The path to the volume

Named Arguments

-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-Block

Block to create the StosGroup within

Default: 'TEM'

-Name

Name of the StosMap

-ControlSection

Control Section Number

-MappedSection

Mapped Section Number

AdjustContrast

Creates a new filter with adjusted contrast. The cutoffs can be adjusted within the meta-data by altering the AutoLevelHint element of the input filters volume.xml meta-data file.

nornir_build volumepath AdjustContrast [-h] [-to [TO ...]] [-cc [CC ...]]
                                       [-Sections SECTIONS]
                                       [-Channels CHANNELSREGEX]
                                       [-Gamma GAMMA] [-MinCutoff MINCUTOFF]
                                       [-MaxCutoff MAXCUTOFF]
                                       -InputFilter INPUTFILTER
                                       [-OutputFilter OUTPUTFILTER]
                                       [-OutputBpp OUTPUTBPP]
                                       -InputTransform INPUTTRANSFORM
                                       volumepath

Positional Arguments

volumepath

The path to the volume

Named Arguments

-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-Sections

Section numbers to process. If omitted all sections are processed. Values are separated with commas and ranges are indicated by hyphens. Ex: ‘1,3,5-7’ == [1,3,5,6,7]

-Channels

Regular expression describing channels to include, * processes all channels

Default: '*'

-Gamma

Gamma value for intensity auto-level

-MinCutoff

Min pixel intensity cutoff as a percentage, 0 to 100

Default: 0.1

-MaxCutoff

Max pixel intensity cutoff as a percentage, 0 to 100. Specifying ‘1’ puts the cutoff at 99% of the maximum pixel intensity value.

Default: 0.5

-InputFilter

Filter to draw images from

Default: 'Raw8'

-OutputFilter

Filter to draw images from

Default: 'Leveled'

-OutputBpp

Bits-per-pixel of output filter images

-InputTransform

Mosaic transform to prune. The transform provides the list of tiles in the mosaic.

Default: 'Prune'

AdoptVikingVolume

Moves and renames files from a Viking volume clone (RC1_Original) into TEM/NNNN/TEM with locked mosaics, stos, and filters. Image bytes are not rewritten. Do not point this at the live Rabbit volume.

nornir_build volumepath AdoptVikingVolume [-h] [-to [TO ...]] [-cc [CC ...]]
                                          [-Sections SECTIONS] [-DryRun]
                                          volumepath ImportDir

Positional Arguments

volumepath

The path to the volume

ImportDir

Viking-layout source volume (the RC1_Original clone). Must not be Rabbit or a folder still named RC1.

Named Arguments

-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-Sections

Section numbers to adopt. If omitted all sections are adopted. Values are separated with commas and ranges are indicated by hyphens. Ex: ‘1,3,5-7’ == [1,3,5,6,7]

-DryRun

Print planned moves without moving files or writing filter/transform nodes.

Default: False

Example: nornir-build AdoptVikingVolume Y:VolumesRC1 Y:VolumesRC1_Original -Sections 1,2,47 -DryRun

AlignSections

Builds section-to-section mappings and computes brute alignment transforms across adjacent sections.

nornir_build volumepath AlignSections [-h] [-to [TO ...]] [-cc [CC ...]]
                                      [-Center CENTER]
                                      [-NumAdjacentSections NUMADJACENTSECTIONS]
                                      [-AngleRange ANGLESEARCHRANGE]
                                      [-Channels CHANNELSREGEX]
                                      [-Filters FILTERSREGEX] [-UseMasks]
                                      -Downsample STOSBRUTEDOWNSAMPLE
                                      [-OutputStosMap OUTPUTSTOSMAP]
                                      [-NoFlipCheck]
                                      [-Method {SliceToSliceMethod.BruteForce,SliceToSliceMethod.LogPolar}]
                                      volumepath

Positional Arguments

volumepath

The path to the volume

Named Arguments

-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-Center

Center section of the volume. Defaults to center if unspecified. The first run center is saved in meta-data and re-used on later runs.

-NumAdjacentSections

Number of adjacent sections to attempt registration with.

Default: 1

-AngleRange

Range of angles to check in degrees not radians

Default: ````

-Channels

Regular expression describing channels to be aligned

Default: '*'

-Filters

Regular expression describing filters to be aligned

Default: '(?![M|m]ask)'

-UseMasks

Use masks for images if they are available. Masked areas are replaced with random noise for alignment purposes.

Default: False

-Downsample

Amount to downsample input images before attempting alignment. Images are padded to the next power of two for the FFT. Large images, roughly greater than 2048x2048, can be very slow.

Default: 1

-OutputStosMap

Name assigned to generated stos map.

Default: 'PotentialRegistrationChain'

-NoFlipCheck

Do not check for flipped sections. Use this option if it is impossible for images to be flipped. Doubles execution speed.

Default: False

-Method

Possible choices: SliceToSliceMethod.BruteForce, SliceToSliceMethod.LogPolar

Method to use for intitial registration

Default: SliceToSliceMethod.LogPolar

Example: nornir-build AlignSections /data/volume -Downsample 8 -Channels .* -Filters Raw8 -OutputStosMap PotentialRegistrationChain

Assemble

Creates an assembled image from a transform and filter. Optionally creates a new channel for output.

nornir_build volumepath Assemble [-h] [-to [TO ...]] [-cc [CC ...]]
                                 [-Sections SECTIONS] [-Downsample LEVELS]
                                 [-NoInterlace] [-Channels CHANNELREGEX]
                                 [-ChannelPrefix OUTPUTCHANNELPREFIX]
                                 [-Filters FILTERREGEX]
                                 [-Transform TRANSFORMNAME] [-Crop CROPBOX]
                                 [-ext IMAGE_EXT]
                                 volumepath

Positional Arguments

volumepath

The path to the volume

Named Arguments

-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-Sections

Section numbers to process. If omitted all sections are processed. Values are separated with commas and ranges are indicated by hyphens. Ex: ‘1,3,5-7’ == [1,3,5,6,7]

-Downsample

Comma separated list of downsample levels for assembling images. If output is desired only one downsample level can be used.

Default: 1

-NoInterlace

Setting this flag skips the interlace step after assemble. Interlaced images load faster on web pages, but are larger than non-interlaced images.

Default: True

-Channels

Regular expression describing channels to be assembled

Default: '*'

-ChannelPrefix

Create a new channel for the output with this prefix and the name of the input.

Default: ''

-Filters

Regular expression describing filters to be assembled

Default: '(?![M|m]ask)'

-Transform

Directory to move assembled images to

Default: 'Grid'

-Crop

Bounding box of region to assemble. Default is no cropping. Form is MinX,MinY,MaxX,MaxY with no spaces.

Default: ````

-ext

Format to save, default is png format. Use npy for Numpy arrays.

Default: 'png'

AssembleStosOverlays

Assembles registered images for .stos files in a group. Typically this is done so quality of registration at that stage can be assessed.

nornir_build volumepath AssembleStosOverlays [-h] [-to [TO ...]]
                                             [-cc [CC ...]]
                                             -StosGroup STOSGROUP
                                             -Downsample INPUTDOWNSAMPLE
                                             -StosMap STOSMAP
                                             volumepath

Positional Arguments

volumepath

The path to the volume

Named Arguments

-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-StosGroup

Stos group to assemble

Default: 'StosBrute'

-Downsample

Downsample level to assemble

-StosMap

Name assigned to generated stos map.

Default: 'FinalStosMap'

AssembleTiles

Build small full-resolution tiles, usually 256x256, that allow regions of the mosaic to be rapidly loaded

nornir_build volumepath AssembleTiles [-h] [-to [TO ...]] [-cc [CC ...]]
                                      [-Sections SECTIONS]
                                      [-Channels CHANNELREGEX]
                                      [-Filters FILTERREGEX]
                                      [-Transform TRANSFORMNAME]
                                      [-HighestDownsample HIGHESTDOWNSAMPLE]
                                      [-Shape SHAPE]
                                      [-MaxWorkingImageArea MAX_TEMP_IMAGE_AREA]
                                      [-IgnoreStale]
                                      volumepath

Positional Arguments

volumepath

The path to the volume

Named Arguments

-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-Sections

Section numbers to process. If omitted all sections are processed. Values are separated with commas and ranges are indicated by hyphens. Ex: ‘1,3,5-7’ == [1,3,5,6,7]

-Channels

Regular expression describing channels to be assembled

Default: '*'

-Filters

Regular expression describing filters to be assembled

Default: '(?![M|m]ask)'

-Transform

Transform defining images into mosaic

Default: 'Grid'

-HighestDownsample

Highest level downsample to generate. Defaults to the level required to show entire section on one tile.

-Shape

The size the tiles passed as a comma-delimited pair of integers. For example 256,512. If a single number is passed it is used for both dimensions

Default: 512,512

-MaxWorkingImageArea

Determines the amount of memory the system should use to generate the tiles. Suggested value is total system memory in bytes divided by four

-IgnoreStale

Setting this flag skips testing existing tiles to ensure they were created after the input transform.

Default: False

AssembleTilesFromImage

Build small full-resolution tiles, usually 256x256, that allow regions of the mosaic to be rapidly loaded. Uses the filter image as source instead of transforms.

nornir_build volumepath AssembleTilesFromImage [-h] [-to [TO ...]]
                                               [-cc [CC ...]]
                                               [-Sections SECTIONS]
                                               [-Channels CHANNELREGEX]
                                               [-Filters FILTERREGEX]
                                               [-HighestDownsample HIGHESTDOWNSAMPLE]
                                               [-Shape SHAPE]
                                               volumepath

Positional Arguments

volumepath

The path to the volume

Named Arguments

-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-Sections

Section numbers to process. If omitted all sections are processed. Values are separated with commas and ranges are indicated by hyphens. Ex: ‘1,3,5-7’ == [1,3,5,6,7]

-Channels

Regular expression describing channels to be assembled

Default: '*'

-Filters

Regular expression describing filters to be assembled

Default: '(?![M|m]ask)'

-HighestDownsample

Highest level downsample to generate. Defaults to the level required to show entire section on one tile.

-Shape

The size the tiles passed as a comma-delimited pair of integers. For example 256,512. If a single number is passed it is used for both dimensions

Default: 512,512

BuildImagePyramids

Rebuild derived ImageSet pyramid levels when a parent image checksum is stale. Does not assemble from tiles. Use after Assemble or to repair coarser levels left behind.

nornir_build volumepath BuildImagePyramids [-h] [-to [TO ...]] [-cc [CC ...]]
                                           [-Sections SECTIONS]
                                           [-Channels CHANNELREGEX]
                                           [-Filters FILTERREGEX]
                                           [-Downsample LEVELS] [-NoInterlace]
                                           volumepath

Positional Arguments

volumepath

The path to the volume

Named Arguments

-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-Sections

Section numbers to process. If omitted all sections are processed. Values are separated with commas and ranges are indicated by hyphens. Ex: ‘1,3,5-7’ == [1,3,5,6,7]

-Channels

Regular expression describing channels to process

Default: '*'

-Filters

Regular expression describing filters to process. Default includes Mask filters.

Default: '*'

-Downsample

Comma separated downsample levels to consider together with existing ImageSet levels. If omitted, all existing levels are used.

Default: ''

-NoInterlace

Setting this flag skips the interlace step after shrink. Interlaced images load faster on web pages, but are larger than non-interlaced images.

Default: True

CalculateStosGroupWarpMetrics

Creates images indicating the amount of warping present in each .stos file in a group. Typically this is done so quality of registration at that stage can be assessed.

nornir_build volumepath CalculateStosGroupWarpMetrics [-h] [-to [TO ...]]
                                                      [-cc [CC ...]]
                                                      -StosGroup STOSGROUP
                                                      -Downsample INPUTDOWNSAMPLE
                                                      -StosMap STOSMAP
                                                      [-MaxAngle MAXREPORTEDANGLE]
                                                      [-RenderToTargetSection]
                                                      volumepath

Positional Arguments

volumepath

The path to the volume

Named Arguments

-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-StosGroup

Stos group to assemble

Default: 'StosBrute'

-Downsample

Downsample level to assemble

-StosMap

Name assigned to generated stos map.

Default: 'FinalStosMap'

-MaxAngle

Maximum angle value, in degrees, in output image heatmaps. Defaults to max angle found for each section. Specify a value to ensure consistent heatmap ranges for each transform. 15-30 degrees is usually a reasonable value.

-RenderToTargetSection

Indicates whether the image is rendered in the source or target section coordinates. Rendering to source will result in a square image. Rendering to target is better for transforms to volume space.

Default: True

Cleanup

Clean common errors from the volume meta-data

nornir_build volumepath Cleanup [-h] [-to [TO ...]] [-cc [CC ...]]
                                [-Sections SECTIONS]
                                volumepath

Positional Arguments

volumepath

The path to the volume

Named Arguments

-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-Sections

Section numbers to edit. Values are separated with commas and ranges are indicated by hyphens. Ex: ‘1,3,5-7’ == [1,3,5,6,7]

CleanupStos

Clean common errors in section mappings

nornir_build volumepath CleanupStos [-h] [-to [TO ...]] [-cc [CC ...]]
                                    volumepath

Positional Arguments

volumepath

The path to the volume

Named Arguments

-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

CopyStosGroup

Create a SliceToSlice transform group

nornir_build volumepath CopyStosGroup [-h] [-to [TO ...]] [-cc [CC ...]]
                                      -Input SOURCEGROUPNAME
                                      -Output TARGETGROUPNAME
                                      [-Block BLOCKNAME]
                                      [-Downsample DOWNSAMPLE]
                                      volumepath

Positional Arguments

volumepath

The path to the volume

Named Arguments

-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-Input

Source StosGroup to copy transforms from.

-Output

Target StosGroup to copy transform to.

-Block

Block to create the StosGroup within

Default: 'TEM'

-Downsample

Downsample level of stos files

Default: 1

CreateBlobFilter

Create a blob filter from an input filter. Blobbing can make brute slice-to-slice alignment more reliable for downsampled mosaics with fine textures.

nornir_build volumepath CreateBlobFilter [-h] [-to [TO ...]] [-cc [CC ...]]
                                         [-Sections SECTIONS]
                                         [-Channels CHANNELREGEX]
                                         -InputFilter INPUTFILTER
                                         [-Levels BLOBDOWNSAMPLELEVELS]
                                         [-Radius BLOBRADIUS]
                                         [-Median BLOBMEDIAN] [-Max BLOBMAX]
                                         [-OutputFilter OUTPUTFILTERNAME]
                                         volumepath

Positional Arguments

volumepath

The path to the volume

Named Arguments

-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-Sections

Section to execute blob on. Values are separated with commas and ranges are indicated by hyphens. Ex: ‘1,3,5-7’ == [1,3,5,6,7]

-Channels

Regular expression describing channels to be assembled

Default: '*'

-InputFilter

Name of filter to create blob filter for

Default: 'Leveled'

-Levels

Downsample levels to be blobbed

Default: 1

-Radius

Radius to calculate variance within

Default: 9

-Median

Median filter radius for input

Default: 7

-Max

Max variance before cropping

Default: 3

-OutputFilter

Prefix added to created filters

Default: 'Blob'

CreateStosGroup

Create a SliceToSlice transform group

nornir_build volumepath CreateStosGroup [-h] [-to [TO ...]] [-cc [CC ...]]
                                        -StosGroup STOSGROUP
                                        [-Block BLOCKNAME]
                                        [-Downsample DOWNSAMPLE]
                                        volumepath

Positional Arguments

volumepath

The path to the volume

Named Arguments

-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-StosGroup

Name of the StosGroup to create

-Block

Block to create the StosGroup within

Default: 'TEM'

-Downsample

Downsample level of stos files

Default: 1

CreateVikingXML

Exports volume metadata and image references into a VikingXML manifest for Viking clients.

nornir_build volumepath CreateVikingXML [-h] [-to [TO ...]] [-cc [CC ...]]
                                        [-StosGroup STOSGROUP]
                                        [-StosMap STOSMAP] [-Host HOST]
                                        -OutputFile OUTPUTFILE
                                        volumepath

Positional Arguments

volumepath

The path to the volume

Named Arguments

-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-StosGroup

Stos group to include (repeat for multiple groups). If not specified only unregistered mosaics are included.

-StosMap

Slice-to-slice mapping of transforms. If not specified only unregistered mosaics are included.

-Host

Url of volume, overrides the about.xml settings

-OutputFile

Name of file to write .VikingXML is appended to name automatically

Example: nornir-build CreateVikingXML /data/volume -OutputFile MyVolume -StosMap FinalStosMap -StosGroup Grid32 -StosGroup SliceToVolume1

ExportAnnotationCrops

Ingests Locations via -OData or -Geometries, then writes lossless PNG crops, 1-bit masks, COCO RLE JSON, and optional overlays. Does not modify VolumeData.xml.

nornir_build volumepath ExportAnnotationCrops [-h] [-to [TO ...]]
                                              [-cc [CC ...]] [-OData ODATA]
                                              [-Geometries GEOMETRIES]
                                              [-ODataFilter ODATAFILTER]
                                              -Output OUTPUTPATH
                                              [-Channels CHANNELS]
                                              [-Filters FILTERS]
                                              [-Downsample DOWNSAMPLE]
                                              [-Exporter EXPORTER] [-Pad PAD]
                                              [-MaxTexture MAXTEXTURE]
                                              [-MaxTiles MAXTILES]
                                              [-MinProcessPixels MINPROCESSPIXELS]
                                              [-Workers WORKERS]
                                              [-MaskWorkers MASKWORKERS]
                                              [-StageTiles STAGETILES]
                                              [-Sections SECTIONS]
                                              [-IncludeOffEdge] [-Force]
                                              [-RefreshOData]
                                              [-FailMissingTileset]
                                              [-NoOverlay] [-Cleanup]
                                              volumepath

Positional Arguments

volumepath

The path to the volume

Named Arguments

-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-OData

Connectome OData V4 service root. Exactly one of -OData or -Geometries is required.

-Geometries

Saved OData Locations dump (JSONL, {value:[]}, or concatenated page documents). Exactly one of -OData or -Geometries is required.

-ODataFilter

Override $filter only. Default selects closed polygons on Cell types including subtypes.

-Output

Directory for PNG crops, JSON, masks, overlays, and _work cache

-Channels

Regular expression for the channel that owns the tileset

Default: 'TEM'

-Filters

Regular expression for the filter that owns the tileset

Default: 'Leveled'

-Downsample

Tileset downsample to train at. With -Exporter tiled, masks that do not fit in one MaxTexture crop are split instead of coarsened.

Default: 1

-Exporter

Crop placement. tiled (default) keeps -Downsample and splits on the half-step lattice. legacy coarsens D until the mask fits one crop and never splits.

Default: 'tiled'

-Pad

Mosaic pixels added to each bbox side. Default is 1.

Default: 1

-MaxTexture

Max pixels per crop axis. Default is 1024.

-MaxTiles

Override floor(MaxTexture / tile dim) for the snapped tile window

-MinProcessPixels

Retained for compatibility. Does not change the training downsample.

Default: 16

-Workers

Stitch PNG encode process-pool size. Default is CPU count. Tile reads use a thread pool sized from CPU count; column bands size themselves from RAM.

-MaskWorkers

Mask rasterize process-pool size. Default is CPU count.

-StageTiles

Scratch root for NAS tile copies. Default is /tmp/nornir-stage-tiles/{volume}/z{section}. Override with a local Linux path (not a Windows/CIFS mount). Cleared after each section.

-Sections

Section numbers to process. Omitted means every Z that has geometries.

-IncludeOffEdge

Keep OffEdge locations. They are skipped by default.

Default: False

-Force

Full rebuild: refetch OData MosaicShape and restitch every crop even when watermarks match.

Default: False

-RefreshOData

Refetch OData MosaicShape into Output/_work, then update masks and JSON (and restitch only where crop windows changed). Unchanged crops are skipped.

Default: False

-FailMissingTileset

Fail instead of skipping a section whose filter has no Tileset/level.

Default: False

-NoOverlay

Skip QA overlay PNGs (TEM + Viking HCL hue, TEM luma). SAM2 does not use them.

Default: False

-Cleanup

Audit and repair corrupt AnnotationCrops products. Does not ingest OData or restitch.

Default: False

Example: nornir-build ExportAnnotationCrops /data/volume -OData http://host/odata -Output /data/sam2 -Channels TEM -Filters Leveled

ExportImages

Copies images of sections to an output directory

nornir_build volumepath ExportImages [-h] [-to [TO ...]] [-cc [CC ...]]
                                     [-Channels CHANNELREGEX]
                                     [-Filters FILTERREGEX]
                                     [-Downsample DOWNSAMPLE]
                                     [-Output OUTPUTPATH]
                                     volumepath

Positional Arguments

volumepath

The path to the volume

Named Arguments

-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-Channels

Regular expression describing channels to be assembled

Default: '*'

-Filters

Regular expression describing filters to be assembled

Default: '(?![M|m]ask)'

-Downsample

Downsample output images by this factor

Default: 1

-Output

Directory to move assembled images to

ExportMetadata

Export all meta-data to a single file

nornir_build volumepath ExportMetadata [-h] [-to [TO ...]] [-cc [CC ...]]
                                       [-Output OUTPUTPATH]
                                       volumepath

Positional Arguments

volumepath

The path to the volume

Named Arguments

-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-Output

Full path of output xml file, defaults to VolumeData.SingleFileBackup.xml in the Volume directory.

ForceUpdateInputTransform

Tells a transform to find its input transform by name, and update its input transform checksum to the current input transform’s checksum. Used is very rare cases where a change adjusts the checksum of an input transform but the content is the same and does not require rebuilding an entire chain of transforms.

nornir_build volumepath ForceUpdateInputTransform [-h] [-to [TO ...]]
                                                  [-cc [CC ...]]
                                                  -Sections SECTIONS
                                                  [-Channels CHANNELREGEX]
                                                  [-Transform TRANSFORMREGEX]
                                                  volumepath

Positional Arguments

volumepath

The path to the volume

Named Arguments

-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-Sections

Section numbers to edit. Values are separated with commas and ranges are indicated by hyphens. Ex: ‘1,3,5-7’ == [1,3,5,6,7]

-Channels

Regular expression describing channels to be edited

Default: '*'

-Transform

Name of the transform to lock/unlock

Default: '*'

GenerateMosaicLayoutSVG

Generates SVG files showing the layout of a given transform

nornir_build volumepath GenerateMosaicLayoutSVG [-h] [-to [TO ...]]
                                                [-cc [CC ...]]
                                                [-Sections SECTIONS]
                                                [-Channels CHANNELSREGEX]
                                                [-Downsample DOWNSAMPLE]
                                                [-Filter INPUTFILTERNAME]
                                                -Transform INPUTTRANSFORMNAME
                                                [-OutputFilename OUTPUTFILENAME]
                                                [-MinOverlap MIN_OVERLAP]
                                                [-IncludeDiagonalOverlaps]
                                                [-ShowFeatureScores]
                                                volumepath

Positional Arguments

volumepath

The path to the volume

Named Arguments

-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-Sections

Section numbers to process. If omitted all sections are processed. Values are separated with commas and ranges are indicated by hyphens. Ex: ‘1,3,5-7’ == [1,3,5,6,7]

-Channels

Regular expression describing channels to include, * processes all channels

Default: '*'

-Downsample

Downsample level to use for ir-tools

-Filter

Filter to use for layouts

-Transform

Name of the input transform

Default: 'Prune'

-OutputFilename

Prefix of output image.

Default: 'Layout'

-MinOverlap

Minimum amount of overlap tiles must have to contribute to the final mosaic.

Default: 0.05

-IncludeDiagonalOverlaps

Setting this flag includes tiles that only have a diagonal overlap, that is the center of the tile is outside the X/Y boundaries of the paired tile. This can introduce extra calculation time and possibly noise but be helpful if the tiles moved considerably during capture or are not laid out on a grid.

Default: True

-ShowFeatureScores

Setting this flag multiplies the alignment weights by the feature score of the overlapping region in the translate phase. This can sometimes reduce the impact of large featureless areas but seems to introduce noise in many other cases.

Default: False

Histogram

Calculates the histogram from all tiles in a mosaic

nornir_build volumepath Histogram [-h] [-to [TO ...]] [-cc [CC ...]]
                                  [-Sections SECTIONS]
                                  [-Channels CHANNELSREGEX]
                                  [-Filters FILTERSREGEX]
                                  -InputTransform INPUTTRANSFORM
                                  [-Downsample DOWNSAMPLE]
                                  volumepath

Positional Arguments

volumepath

The path to the volume

Named Arguments

-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-Sections

Section numbers to process. If omitted all sections are processed. Values are separated with commas and ranges are indicated by hyphens. Ex: ‘1,3,5-7’ == [1,3,5,6,7]

-Channels

Regular expression describing channels to include, * processes all channels

Default: '*'

-Filters

Regular expression describing filters to include, * processes all filters

Default: '(?![M|m]ask)'

-InputTransform

The transform provided the list of tiles in the mosaic.

Default: 'Prune'

-Downsample

Use downsampled tiles for faster histogram calculation

Default: 1

ImportDM4

Imports DM4 tile datasets into channels/sections and records overlap metadata for mosaic registration.

nornir_build volumepath ImportDM4 [-h] [-to [TO ...]] [-cc [CC ...]]
                                  [-ext EXTENSION] [-Sections SECTIONS]
                                  [-overlap TILE_OVERLAP]
                                  volumepath ImportDir

Positional Arguments

volumepath

The path to the volume

ImportDir

Directory to import from

Named Arguments

-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-ext

Extension of digital micrograph version 4 files, default is dm4

Default: 'dm4'

-Sections

Section numbers to process. If omitted all sections are processed. Values are separated with commas and ranges are indicated by hyphens. Ex: ‘1,3,5-7’ == [1,3,5,6,7]

-overlap

Overlap of tiles as a percentage, either a single value or a comma-delimited pair (X%,Y%).ntex: 15 would be a 15 overlap on both axis.ntex: 10,20 would be a 10% X overlap and 20% Y overlap.

Example: nornir-build ImportDM4 /data/volume /data/dm4 -Sections 1-20 -overlap 10,20

ImportIDoc

Imports SerialEM IDOC metadata and tile images into VolumeData.xml sections/channels. Use this as the normal first step for IDOC datasets before prune/mosaic alignment.

nornir_build volumepath ImportIDoc [-h] [-to [TO ...]] [-cc [CC ...]]
                                   [-ext EXTENSION] [-Min MINVALUE]
                                   [-Max MAXVALUE] [-Sections SECTIONS]
                                   [-CameraBpp CAMERABPP]
                                   volumepath ImportDir

Positional Arguments

volumepath

The path to the volume

ImportDir

Directory to import from. The .idoc files in subdirectories should be named with the desired section number after import. i.e. 0005.idoc to import the file as section #5.

Named Arguments

-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-ext

Extension of idoc files, default is idoc

Default: '*.idoc'

-Min

Min intensity cutoff. A value from 0.0 to 1.0

Default: 0.0001

-Max

Max intensity cutoff. A value from 0.0 to 1.0

Default: 0.9999

-Sections

Section numbers to process. If omitted all sections are processed. Values are separated with commas and ranges are indicated by hyphens. Ex: ‘1,3,5-7’ == [1,3,5,6,7]

-CameraBpp

The actual bits-per-pixel of the camera. Limits the range of image histograms being expanded beyond reason due to errors in input image data or meta-data.

Example: nornir-build ImportIDoc /data/volume /data/idoc -Sections 1-10 -CameraBpp 14

ImportImages

Import single images that represent an entire section in a volume

nornir_build volumepath ImportImages [-h] [-to [TO ...]] [-cc [CC ...]]
                                     -Scale SCALEVALUEINNM [-ext EXTENSION]
                                     volumepath ImportDir

Positional Arguments

volumepath

The path to the volume

ImportDir

Directory to import from

Named Arguments

-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-Scale

Pixel size in nanometers

-ext

Extension of image files, default is png

Default: 'png'

ImportMRC

Import SerialEM MRC files into a volume.

nornir_build volumepath ImportMRC [-h] [-to [TO ...]] [-cc [CC ...]]
                                  [-ext EXTENSION] [-Min MINVALUE]
                                  [-Max MAXVALUE] [-CameraBpp CAMERABPP]
                                  volumepath ImportDir

Positional Arguments

volumepath

The path to the volume

ImportDir

Directory to import from. The .mrc files in subdirectories should be named with the desired section number after import. i.e. 0005.mrc to import the file as section #5.

Named Arguments

-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-ext

Extension of mrc files, default is mrc

Default: 'mrc'

-Min

Min intensity cutoff. A value from 0.0 to 1.0

Default: 0.0001

-Max

Max intensity cutoff. A value from 0.0 to 1.0

Default: 0.9999

-CameraBpp

The actual bits-per-pixel of the camera. Limits the range of image histograms being expanded beyond reason due to errors in input image data or meta-data.

ImportPMG

Imports PMG files named with section/channel metadata into a volume. Use -Scale to provide nanometers-per-pixel for downstream geometry and reporting.

nornir_build volumepath ImportPMG [-h] [-to [TO ...]] [-cc [CC ...]]
                                  -Scale SCALEVALUEINNM [-ext EXTENSION]
                                  volumepath ImportDir

Positional Arguments

volumepath

The path to the volume

ImportDir

Directory to import from. The PMG file should follow this format: Slide#_Block#_Section#_Initials_Mag_Spot_Probe. However only Section and Probe are used as the section number and channel name respectively. The rest is stored as meta-data.

Named Arguments

-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-Scale

Pixel size in nanometers

-ext

Extension of pmg files, default is pmg

Default: 'pmg'

Example: nornir-build ImportPMG /data/volume /data/pmg -Scale 4.0

InvertFilter

Produce a new filter, inverted from the input

nornir_build volumepath InvertFilter [-h] [-to [TO ...]] [-cc [CC ...]]
                                     [-Sections SECTIONS]
                                     [-Channels CHANNELSREGEX]
                                     -InputFilter FILTERSREGEX
                                     -OutputFilter OUTPUTFILTER
                                     volumepath

Positional Arguments

volumepath

The path to the volume

Named Arguments

-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-Sections

Section numbers to process. If omitted all sections are processed. Values are separated with commas and ranges are indicated by hyphens. Ex: ‘1,3,5-7’ == [1,3,5,6,7]

-Channels

Regular expression describing channels to include, * processes all channels

Default: '*'

-InputFilter

The filter to invert

-OutputFilter

Prefix added to output filters

Default: 'Inverted'

LinearizeVolume

Undocumented

nornir_build volumepath LinearizeVolume [-h] [-to [TO ...]] [-cc [CC ...]]
                                        -InputGroup INPUTGROUPNAME
                                        -InputDownsample INPUTDOWNSAMPLE
                                        -OutputGroup OUTPUTGROUPNAME
                                        [-min_blend MIN_BLEND]
                                        [-linear_factor LINEAR_BLEND_FACTOR]
                                        [-max_blend MAX_BLEND]
                                        [-travel_limit TRAVEL_LIMIT]
                                        [-reblend_iterations REBLEND_ITERATIONS]
                                        [-reblend_tolerance REBLEND_TOLERANCE]
                                        [-no_rotation] [-workers WORKERS]
                                        volumepath

Positional Arguments

volumepath

The path to the volume

Named Arguments

-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-InputGroup

Name of stos group to linearize

-InputDownsample

Downsample level of input stosgroup

-OutputGroup

Name of the output stos group

-min_blend

Floor weight toward rigid linear blend (0–1). Uniform when -travel_limit is omitted.

Default: 0.05

-linear_factor

Deprecated alias for -min_blend.

-max_blend

Cap per-point rigid blend weight (0–1). Defaults to min_blend without travel_limit, else 0.9.

-travel_limit

Full-resolution distance scale for smooth per-point blend toward the rigid transform prediction.

Default: 512

-reblend_iterations

Iterative linear-blend passes per transform composition. Use 1 for a single pass.

Default: 8

-reblend_tolerance

Stop re-blending when the maximum control-point movement falls below this distance (pixels at working resolution).

Default: 0.5

-no_rotation

Added for SEM volumes where it is certain there is no rotation from section to section, defaults to False

Default: False

-workers

Parallel worker count for per-transform linear blend. Defaults to CPU count; use 1 for serial.

ListBlockStosMaps

List all SliceToSlice maps in a block

nornir_build volumepath ListBlockStosMaps [-h] [-to [TO ...]] [-cc [CC ...]]
                                          [-Block BLOCKNAME]
                                          volumepath

Positional Arguments

volumepath

The path to the volume

Named Arguments

-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-Block

Name of block

Default: 'TEM'

ListDamagedSections

Print a list of all damaged sections. Damaged sections are never used as control sections when chaining slice-to-slice transforms together to build slice-to-volume transforms

nornir_build volumepath ListDamagedSections [-h] [-to [TO ...]] [-cc [CC ...]]
                                            [-Block BLOCKREGEX]
                                            volumepath

Positional Arguments

volumepath

The path to the volume

Named Arguments

-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-Block

Regular expression describing blocks to include, * processes all blocks

Default: '*'

ListFilterContrast

Print a list of the contrast settings used for all sections.

nornir_build volumepath ListFilterContrast [-h] [-to [TO ...]] [-cc [CC ...]]
                                           [-Sections SECTIONS]
                                           [-Channels CHANNELSREGEX]
                                           [-Filters FILTERSREGEX]
                                           volumepath

Positional Arguments

volumepath

The path to the volume

Named Arguments

-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-Sections

Section numbers to process. If omitted all sections are processed. Values are separated with commas and ranges are indicated by hyphens. Ex: ‘1,3,5-7’ == [1,3,5,6,7]

-Channels

Regular expression describing channels to include, * processes all channels

Default: '*'

-Filters

Regular expression describing filters to include, * processes all filters

Default: '(?![M|m]ask)'

ListGroupSectionMappings

List all SliceToSlice transform groups

nornir_build volumepath ListGroupSectionMappings [-h] [-to [TO ...]]
                                                 [-cc [CC ...]]
                                                 [-Block BLOCKNAME]
                                                 -StosGroup STOSGROUP
                                                 -Downsample DOWNSAMPLE
                                                 volumepath

Positional Arguments

volumepath

The path to the volume

Named Arguments

-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-Block

Block to create the StosGroup within

Default: 'TEM'

-StosGroup

Name of the StosGroup

-Downsample

Downsample level of stos files

ListMissingTilesets

Print a list of filters without tilesets

nornir_build volumepath ListMissingTilesets [-h] [-to [TO ...]] [-cc [CC ...]]
                                            [-Sections SECTIONS]
                                            [-Channels CHANNELSREGEX]
                                            [-Filters FILTERSREGEX]
                                            volumepath

Positional Arguments

volumepath

The path to the volume

Named Arguments

-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-Sections

Section numbers to process. If omitted all sections are processed. Values are separated with commas and ranges are indicated by hyphens. Ex: ‘1,3,5-7’ == [1,3,5,6,7]

-Channels

Regular expression describing channels to include, * processes all channels

Default: '*'

-Filters

Regular expression describing filters to include, * processes all filters

Default: '*'

ListPruneCutoff

List the prune thresholds set for a filter

nornir_build volumepath ListPruneCutoff [-h] [-to [TO ...]] [-cc [CC ...]]
                                        [-Sections SECTIONS]
                                        [-Channels CHANNELREGEX]
                                        [-Filters FILTERREGEX]
                                        [-header_fill HEADER_FILL]
                                        [-fill VALUE_FILL]
                                        volumepath

Positional Arguments

volumepath

The path to the volume

Named Arguments

-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-Sections

Section numbers to edit. Values are separated with commas and ranges are indicated by hyphens. Ex: ‘1,3,5-7’ == [1,3,5,6,7]. Defaults to every section

-Channels

Regular expression describing channels to be edited

Default: '*'

-Filters

Regular expression describing filters to be edited

Default: '*'

-header_fill

The amount of padding to use for names in the list

Default: 12

-fill

The amount of padding to use for prune values in the list

Default: 6

ListStosGroups

List all SliceToSlice transform groups

nornir_build volumepath ListStosGroups [-h] [-to [TO ...]] [-cc [CC ...]]
                                       [-Block BLOCKNAME]
                                       volumepath

Positional Arguments

volumepath

The path to the volume

Named Arguments

-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-Block

Block to create the StosGroup within

Default: 'TEM'

ListStosMap

List all SliceToSlice mappings within a stos map

nornir_build volumepath ListStosMap [-h] [-to [TO ...]] [-cc [CC ...]]
                                    [-Block BLOCKNAME] -Name STOSMAPNAME
                                    volumepath

Positional Arguments

volumepath

The path to the volume

Named Arguments

-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-Block

Block to create the StosGroup within

Default: 'TEM'

-Name

Name of the StosMap

MarkSectionsDamaged

Mark sections as damaged. Damaged sections are never used as control sections when chaining slice-to-slice transforms together to build slice-to-volume transforms

nornir_build volumepath MarkSectionsDamaged [-h] [-to [TO ...]] [-cc [CC ...]]
                                            [-Block BLOCKREGEX]
                                            [-Sections SECTIONS]
                                            volumepath

Positional Arguments

volumepath

The path to the volume

Named Arguments

-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-Block

Regular expression describing blocks to include, * processes all blocks

Default: '*'

-Sections

Section numbers that should not be used as control sections. Values are separated with commas and ranges are indicated by hyphens. Ex: ‘1,3,5-7’ == [1,3,5,6,7]

MarkSectionsUndamaged

Remove sections from the damaged list. Damaged sections are never used as control sections when chaining slice-to-slice transforms together to build slice-to-volume transforms

nornir_build volumepath MarkSectionsUndamaged [-h] [-to [TO ...]]
                                              [-cc [CC ...]]
                                              [-Block BLOCKREGEX]
                                              [-Sections SECTIONS]
                                              volumepath

Positional Arguments

volumepath

The path to the volume

Named Arguments

-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-Block

Regular expression describing blocks to include, * processes all blocks

Default: '*'

-Sections

Section numbers to remove from the damaged list. Values are separated with commas and ranges are indicated by hyphens. Ex: ‘1,3,5-7’ == [1,3,5,6,7]

Mosaic

Runs grid registration/refinement to produce an output transform and assembled mosaic for each selected section/channel.

nornir_build volumepath Mosaic [-h] [-to [TO ...]] [-cc [CC ...]]
                               [-Sections SECTIONS] [-Channels CHANNELSREGEX]
                               [-RegistrationDownsample DOWNSAMPLE]
                               -InputFilter INPUTFILTER
                               [-InputTransform INPUTTRANSFORMNAME]
                               [-OutputTransform OUTPUTTRANSFORMNAME]
                               [-RefineIterations REFINEITERATIONS]
                               [-Threshold DISPLACEMENTTHRESHOLD]
                               [-MinOverlap MIN_OVERLAP]
                               [-ExpandOverlapScalar EXCESS_SCALAR]
                               [-first_pass_inter_tile_distance FIRST_PASS_INTER_TILE_DISTANCE]
                               [-inter_tile_distance INTER_TILE_DISTANCE]
                               [-MinFeatureScore FEATURE_SCORE_THRESHOLD]
                               [-MinTranslateIterations MIN_TRANSLATE_ITERATIONS]
                               [-MaxTranslateIterations MAX_TRANSLATE_ITERATIONS]
                               [-RelaxIterations MAX_RELAX_ITERATIONS]
                               [-OffsetChangeTolerance OFFSET_ACCEPTANCE_THRESHOLD]
                               [-PhaseCorrelationExponent OFFSET_ACCEPTANCE_THRESHOLD]
                               [-RelaxThreshold MAX_RELAX_TENSION_CUTOFF]
                               [-CellArea CELLAREA] [-MeshSize MESHSIZE]
                               [-IncludeDiagonalOverlaps]
                               [-ScaleWeightByFeatureScore]
                               volumepath

Positional Arguments

volumepath

The path to the volume

Named Arguments

-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-Sections

Section numbers to process. If omitted all sections are processed. Values are separated with commas and ranges are indicated by hyphens. Ex: ‘1,3,5-7’ == [1,3,5,6,7]

-Channels

Regular expression describing channels to include, * processes all channels

Default: '*'

-RegistrationDownsample

Downsample level to use for ir-tools

Default: 4

-InputFilter

Filter to use for registration

Default: 'Raw8'

-InputTransform

Name of the input transform

Default: 'Prune'

-OutputTransform

Name of output transform.

Default: 'Grid'

-RefineIterations

Maximum number of refinement passes to run

Default: 10

-Threshold

Displacement threshold for control point movement (in pixels). Refinement stops below this value

Default: 0.25

-MinOverlap

Minimum amount of overlap tiles must have to contribute to the final mosaic.

Default: 0.05

-ExpandOverlapScalar

How much additional area should we pad the overlapping regions with.

Default: 1.0

-first_pass_inter_tile_distance

A value from 0 to 1 that scales the distance between the centers of the two tiles. A value of 0 considers the full images when registering. A value of 1.0 only considers the overlapping regions according to the tile transforms. Reduce this value in the first registration pass to increase the search area.

Default: 0.75

-inter_tile_distance

A value from 0 to 1 that scales the distance between the centers of the two tiles. A value of 0 considers the full images when registering. A value of 1.0 only considers the overlapping regions according to the tile transforms. Reduce this value in early registration passes to increase the search area.

Default: 1

-MinFeatureScore

Minimum average FFT power spectral density. Determines if overlapping have enough texture for registration to be accurate.

-MinTranslateIterations

Minimum number of iterations phase correlation and relaxation

Default: 1

-MaxTranslateIterations

Maximum number of iterations phase correlation and relaxation

Default: 5

-RelaxIterations

Maximum number of relaxation passes to in translation only placement phase

Default: 500

-OffsetChangeTolerance

Do not re-register (recalculate phase correlation of) a pair of overlapping tiles if the change in overlap position compared to the previous iteration is less than this distance in pixels.

Default: 1

-PhaseCorrelationExponent

Setting this value to 1 is equivalent to using phase correlation. Setting it to 0 is equivalent to using Pierson Correlation. The default is .65. If you have a difficult to register section changing this value to 1 may help.

Default: 0.65

-RelaxThreshold

Stop iteration of relaxation phase if the maximum weighted tension vector on all tiles is below this value (in pixels).

Default: 0.5

-CellArea

Size of region around each grid point to register, in pixels

Default: 128

-MeshSize

How many registration points are spaced along the images, the same value is used for X and Y. This should be a large enough number to provide 25% or ideally 50% overlap of grid cells for the expected image size.

Default: 8

-IncludeDiagonalOverlaps

Setting this flag includes tiles that only have a diagonal overlap, that is the center of the tile is outside the X/Y boundaries of the paired tile. This can introduce extra calculation time and possibly noise but be helpful if the tiles moved considerably during capture or are not laid out on a grid.

Default: True

-ScaleWeightByFeatureScore

Setting this flag multiplies the alignment weights by the feature score of the overlapping region in the translate phase. This can sometimes reduce the impact of large featureless areas but seems to introduce noise in many other cases.

Default: False

Example: nornir-build Mosaic /data/volume -InputFilter Raw8 -InputTransform Prune -OutputTransform Grid -RegistrationDownsample 4

MosaicNoTranslate

Aligns tiles of a filter into a single mosaic. Produces an assembled mosaic image. Assumes stage coordinates are correct and refines distortions only without translating tiles.

nornir_build volumepath MosaicNoTranslate [-h] [-to [TO ...]] [-cc [CC ...]]
                                          [-Sections SECTIONS]
                                          [-Channels CHANNELSREGEX]
                                          [-RegistrationDownsample DOWNSAMPLE]
                                          [-RefineIterations REFINEITERATIONS]
                                          [-CellArea CELLAREA]
                                          [-Threshold DISPLACEMENTTHRESHOLD]
                                          [-MaxOffset MAXOFFSET]
                                          -InputFilter INPUTFILTER
                                          [-InputTransform INPUTTRANSFORMNAME]
                                          [-OutputTransform OUTPUTTRANSFORMNAME]
                                          volumepath

Positional Arguments

volumepath

The path to the volume

Named Arguments

-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-Sections

Section numbers to process. If omitted all sections are processed. Values are separated with commas and ranges are indicated by hyphens. Ex: ‘1,3,5-7’ == [1,3,5,6,7]

-Channels

Regular expression describing channels to include, * processes all channels

Default: '*'

-RegistrationDownsample

Downsample level to use for ir-tools

Default: 4

-RefineIterations

Maximum number of refinement passes to run

Default: 10

-CellArea

Size of region around each grid point to register, in pixels

Default: 128

-Threshold

Displacement threshold for control point movement (in pixels). Refinement stops below this value

Default: 0.1

-MaxOffset

Comma separated list of downsample levels used for assembling output images

Default: 0.5

-InputFilter

Filter to use for registration

Default: 'Raw8'

-InputTransform

Name of the input transform

Default: 'Prune'

-OutputTransform

Name of output transform.

Default: 'Grid'

MosaicReport

Generate a web page summarizing the output of 2D section mosaics. Includes prune scores, contrast histograms, and assembled images if any.

nornir_build volumepath MosaicReport [-h] [-to [TO ...]] [-cc [CC ...]]
                                     [-PruneFilter PRUNEFILTER]
                                     [-ContrastFilter CONTRASTFILTER]
                                     [-AssembleFilter ASSEMBLEFILTER]
                                     [-AssembleDownsample ASSEMBLEDOWNSAMPLE]
                                     [-RowsPerPage ROWSPERPAGE]
                                     [-Output OUTPUTPATH]
                                     [-BuilderEndpoint BUILDERENDPOINT]
                                     volumepath

Positional Arguments

volumepath

The path to the volume

Named Arguments

-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-PruneFilter

Input filter passed to Prune pipeline

Default: 'Raw8'

-ContrastFilter

Input filter passed to Adjust Contrast pipeline

Default: 'Raw8'

-AssembleFilter

Input filter passed to Assemble or Mosaic pipeline

Default: 'Raw8'

-AssembleDownsample

Downsample level to build assembled image thumbnails from

Default: 1

-RowsPerPage

How many rows to place on a page before dividing into multiple pages

Default: 50

-Output

Name of report html file

Default: 'ImageReport.html'

-BuilderEndpoint

Endpoint for builder

MosaicToVolume

Used after slice to volume. Creates new mosaic transforms that map tiles directly into the volume space. This is done by passing the mosaic transform through a slice-to-volume transformation. Assemble can then be used to produce volume registered images.

nornir_build volumepath MosaicToVolume [-h] [-to [TO ...]] [-cc [CC ...]]
                                       [-Channels CHANNELSREGEX]
                                       [-InputDownsample STOSDOWNSAMPLE]
                                       [-InputMap INPUTMAPNAME]
                                       [-InputGroup INPUTSTOSGROUP]
                                       [-InputTransform INPUTTRANSFORMNAME]
                                       [-OutputTransform OUTPUTTRANSFORM]
                                       volumepath

Positional Arguments

volumepath

The path to the volume

Named Arguments

-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-Channels

Regular expression describing channels to be processed

Default: '*'

-InputDownsample

Downsample level of input stosgroup

Default: 1

-InputMap

Name of output group

Default: 'SliceToVolume'

-InputGroup

Name of stos group to pass mosaic transforms through

Default: 'SliceToVolume'

-InputTransform

Mosaic transform to pass through slice-to-slice transform

Default: 'Grid'

-OutputTransform

Name of output transform mapping a channel to a volume

Default: 'ChannelToVolume'

PrintContrast

Print the contrast parameters for a filter

nornir_build volumepath PrintContrast [-h] [-to [TO ...]] [-cc [CC ...]]
                                      -Sections SECTIONS
                                      [-Channels CHANNELREGEX]
                                      [-Filters FILTERREGEX]
                                      volumepath

Positional Arguments

volumepath

The path to the volume

Named Arguments

-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-Sections

Section numbers to edit. Values are separated with commas and ranges are indicated by hyphens. Ex: ‘1,3,5-7’ == [1,3,5,6,7]

-Channels

Regular expression describing channels to be edited

Default: '*'

-Filters

Regular expression describing filters to be edited

Default: '*'

Prune

Scores tiles for texture complexity and removes low-information tiles from a mosaic transform. Run before Mosaic to improve registration robustness.

nornir_build volumepath Prune [-h] [-to [TO ...]] [-cc [CC ...]]
                              [-Sections SECTIONS] [-Channels CHANNELSREGEX]
                              -DefaultThreshold DEFAULTPRUNETHRESHOLD
                              [-InputFilter INPUTFILTER]
                              [-Downsample DOWNSAMPLE]
                              [-InputTransform INPUTTRANSFORM]
                              [-OutputTransform OUTPUTTRANSFORM]
                              [-overlap OVERLAP]
                              volumepath

Positional Arguments

volumepath

The path to the volume

Named Arguments

-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-Sections

Section numbers to process. If omitted all sections are processed. Values are separated with commas and ranges are indicated by hyphens. Ex: ‘1,3,5-7’ == [1,3,5,6,7]

-Channels

Regular expression describing channels to include, * processes all channels

Default: '*'

-DefaultThreshold

Texture complexity threshold, this value is used if not user defined value is set and no previous prune operation has been run. To change this value for an already built section, use SetPruneCutoff

-InputFilter

Filter to calculate complexity upon

Default: 'Raw8'

-Downsample

Tiles are downsampled by this factor before being scored

Default: 1

-InputTransform

Mosaic transform to prune. The transform provides the list of tiles in the mosaic.

Default: 'Stage'

-OutputTransform

Name of output transform. Contains tiles from input transform minus tiles below threshold.

Default: 'Prune'

-overlap

Percentage overlap between tiles, 0.0 to 1.0

Default: 0.1

Example: nornir-build Prune /data/volume -InputFilter Raw8 -DefaultThreshold 0.2 -Sections 1-10

RefineSectionAlignment

Refines slice-to-slice alignment at the given downsample level. This pipeline is often used iteratively at higher and higher resolutions to improve registration quality.

nornir_build volumepath RefineSectionAlignment [-h] [-to [TO ...]]
                                               [-cc [CC ...]]
                                               [-SectionMap STOSMAP]
                                               [-InputGroup INPUTGROUP]
                                               -InputDownsample INPUTDOWNSAMPLE
                                               [-OutputGroup OUTPUTGROUP]
                                               -OutputDownsample OUTPUTDOWNSAMPLE
                                               [-Filters FILTERSREGEX]
                                               [-IgnoreMasks]
                                               [-Spacing GRID_SPACING]
                                               [-CellArea CELL_SIZE]
                                               [-Iterations NUM_ITERATIONS]
                                               [-AngleRange ANGLES_TO_SEARCH]
                                               [-MaxTravelForFinalization MAX_TRAVEL_FOR_FINALIZATION]
                                               [-MaxTravelForFinalizedImprovement MAX_TRAVEL_FOR_FINALIZATION_IMPROVEMENT]
                                               [-MinAlignOverlap MIN_ALIGNMENT_OVERLAP]
                                               [-MinUnmaskedCellArea MIN_UNMASKED_AREA]
                                               [-SaveImages] [-SavePlots]
                                               [-MappedSections MAPPEDSECTIONS]
                                               volumepath

Positional Arguments

volumepath

The path to the volume

Named Arguments

-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-SectionMap

Map describing which sections register to each other

Default: 'FinalStosMap'

-InputGroup

Map describing which sections register to each other

Default: 'StosBrute'

-InputDownsample

Downsample level to use for input

-OutputGroup

Name of output group

Default: 'StosGrid'

-OutputDownsample

Downsample level to use for refinement

-Filters

Regular expression describing filters to be aligned

Default: '(?![M|m]ask)'

-IgnoreMasks

Ignore masks for images if they are available. Masked areas are replaced with random noise for alignment purposes.

Default: False

-Spacing

Grid cell spacing in pixels

Default: 192

-CellArea

Area around each grid point to register, in pixels. It is suggested to have overlap between the cells. So cells of [128,128] would be spaced [64,64] apart.

Default: 256

-Iterations

Maximum number of refinement passes to run

Default: 10

-AngleRange

Range of angles to check in degrees not radians. Each cell is rotated by the angle and checked. The highest scoring registration is used.

-MaxTravelForFinalization

The maximum amount of travel a point can have from its predicted position for it is considered correctly placed.

-MaxTravelForFinalizedImprovement

When finalized points are checked to see if they need to be nudged, they must move less than this distance to be considered. If None, no limit is applied.

-MinAlignOverlap

The minimum amount of overlap a cell (point) must have with its expected position for a registration result to be considered valid.

-MinUnmaskedCellArea

Amount of cell area that must be unmasked to attempt registering a given cell

-SaveImages

Amount of cell area that must be unmasked to attempt registering a given cell

Default: False

-SavePlots

Amount of cell area that must be unmasked to attempt registering a given cell

Default: False

-MappedSections

Section numbers to map to control sections. If omitted all sections are processed. Values are separated with commas and ranges are indicated by hyphens. Ex: ‘1,3,5-7’ == [1,3,5,6,7]

RefineSectionAlignment-IrTools

Refines slice-to-slice alignment at the given downsample level. This pipeline is often used iteratively at higher and higher resolutions to improve registration quality.

nornir_build volumepath RefineSectionAlignment-IrTools [-h] [-to [TO ...]]
                                                       [-cc [CC ...]]
                                                       [-SectionMap STOSMAP]
                                                       [-InputGroup INPUTGROUP]
                                                       -InputDownsample INPUTDOWNSAMPLE
                                                       [-OutputGroup OUTPUTGROUP]
                                                       -OutputDownsample OUTPUTDOWNSAMPLE
                                                       [-Filters FILTERSREGEX]
                                                       [-UseMasks]
                                                       [-Threshold DISPLACEMENTTHRESHOLD]
                                                       [-Spacing GRIDSPACING]
                                                       [-CellArea CELLAREA]
                                                       [-Iterations ITERATIONS]
                                                       volumepath

Positional Arguments

volumepath

The path to the volume

Named Arguments

-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-SectionMap

Map describing which sections register to each other

Default: 'FinalStosMap'

-InputGroup

Map describing which sections register to each other

Default: 'StosBrute'

-InputDownsample

Downsample level to use for input

-OutputGroup

Name of output group

Default: 'StosGrid'

-OutputDownsample

Downsample level to use for refinement

-Filters

Regular expression describing filters to be aligned

Default: '(?![M|m]ask)'

-UseMasks

Use masks for images if they are available. Masked areas are replaced with random noise for alignment purposes.

Default: False

-Threshold

Displacement threshold for control point movement. Refinement stops below this value

Default: 0.1

-Spacing

Grid spacing in pixels

Default: 128

-CellArea

Size of region around each grid point to register, in pixels

Default: 256

-Iterations

Maximum number of refinement passes to run

Default: 10

RemoveFromStosMap

List all SliceToSlice mappings within a stos map

nornir_build volumepath RemoveFromStosMap [-h] [-to [TO ...]] [-cc [CC ...]]
                                          [-Block BLOCKNAME] -Name STOSMAPNAME
                                          -ControlSection CONTROLSECTION
                                          -MappedSection MAPPEDSECTION
                                          volumepath

Positional Arguments

volumepath

The path to the volume

Named Arguments

-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-Block

Block to create the StosGroup within

Default: 'TEM'

-Name

Name of the StosMap

-ControlSection

Control Section Number

-MappedSection

Mapped Section Number

RemoveStosGroup

Remove a SliceToSlice transform group

nornir_build volumepath RemoveStosGroup [-h] [-to [TO ...]] [-cc [CC ...]]
                                        -StosGroup STOSGROUP
                                        [-Block BLOCKNAME]
                                        [-Downsample DOWNSAMPLE]
                                        volumepath

Positional Arguments

volumepath

The path to the volume

Named Arguments

-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-StosGroup

Name of the StosGroup to remove

-Block

Block to create the StosGroup within

Default: 'TEM'

-Downsample

Downsample level of stos files

Default: 1

RemoveTransform

Remove a transform from the volume entirely

nornir_build volumepath RemoveTransform [-h] [-to [TO ...]] [-cc [CC ...]]
                                        -IgnoreLock -Sections SECTIONS
                                        [-Channels CHANNELREGEX]
                                        -Transform TRANSFORMREGEX
                                        volumepath

Positional Arguments

volumepath

The path to the volume

Named Arguments

-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-IgnoreLock

Ignore Filter and Transform Locks, use with care.

Default: False

-Sections

Section numbers to edit. Values are separated with commas and ranges are indicated by hyphens. Ex: ‘1,3,5-7’ == [1,3,5,6,7]

-Channels

Regular expression describing channels to be edited

Default: '*'

-Transform

Name of the transform to lock/unlock

Default: '*'

RenameFilter

Renames a filter across channels/sections and updates linked filter paths.

nornir_build volumepath RenameFilter [-h] [-to [TO ...]] [-cc [CC ...]]
                                     -InputFilter INPUTFILTER
                                     -OutputFilter NEWNAME
                                     volumepath

Positional Arguments

volumepath

The path to the volume

Named Arguments

-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-InputFilter

Existing filter name to rename (exact name match, not regex)

-OutputFilter

New filter name to assign (exact value)

RepairAnnotationOverlays

Composites TEM crop + 1-bit masks into overlays/ without restitching tiles or ingesting OData. Always rewrites overlay PNGs. Temporary helper after overlay-style changes.

nornir_build volumepath RepairAnnotationOverlays [-h] [-to [TO ...]]
                                                 [-cc [CC ...]]
                                                 -Output OUTPUTPATH
                                                 [-Sections SECTIONS]
                                                 volumepath

Positional Arguments

volumepath

The path to the volume

Named Arguments

-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-Output

Directory that already contains images/, masks/, and optional _work watermarks

-Sections

Section numbers to repair. Omitted means every Z with a watermark, else every crop image.

Example: nornir-build RepairAnnotationOverlays /data/volume -Output /data/volume/AnnotationCrops

RepairStosAngles

Negate angles for .stos files created before Dec 1st 2023

nornir_build volumepath RepairStosAngles [-h] [-to [TO ...]] [-cc [CC ...]]
                                         [-Block BLOCKREGEX]
                                         [-StosGroup STOSGROUP] [-Type TYPE]
                                         volumepath

Positional Arguments

volumepath

The path to the volume

Named Arguments

-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-Block

Block to examine the StosGroup within

Default: '*'

-StosGroup

Name of the StosGroup

Default: '*'

-Type

Type of transform

Default: 'Brute'

ReportVolumeBounds

Generate a web page summarizing the output of 2D section mosaics. Includes prune scores, contrast histograms, and assembled images if any.

nornir_build volumepath ReportVolumeBounds [-h] [-to [TO ...]] [-cc [CC ...]]
                                           -Channels CHANNELREGEX
                                           -Transforms TRANSFORMSREGEX
                                           [-StosMap STOSMAP]
                                           volumepath

Positional Arguments

volumepath

The path to the volume

Named Arguments

-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-Channels

Regular expression describing channels to be assembled

-Transforms

Transform defining images into mosaic

-StosMap

Slice-to-slice mapping of transforms. If not specified only unregistered mosaics are included.

ScaleVolumeTransforms

Scales a stos group to use a different downsample level. Useful for producing full-resolution output after generating transforms using downsampled images.

nornir_build volumepath ScaleVolumeTransforms [-h] [-to [TO ...]]
                                              [-cc [CC ...]]
                                              -InputGroup SCALEGROUPNAME
                                              -InputDownsample SCALEINPUTDOWNSAMPLE
                                              [-OutputDownsample SCALEOUTPUTDOWNSAMPLE]
                                              [-UseMasks] [-workers WORKERS]
                                              volumepath

Positional Arguments

volumepath

The path to the volume

Named Arguments

-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-InputGroup

Name of stos group to scale

-InputDownsample

Downsample level of input stosgroup

-OutputDownsample

Downsample level of output. Defaults to 1.

Default: 1

-UseMasks

Use masks for images if they are available. Masked areas are replaced with random noise for alignment purposes.

Default: False

-workers

Parallel worker count for per-transform scaling. Defaults to CPU count; use 1 for serial.

ScoreAnnotationCrops

Writes sam2* columns on annotation_crops.sqlite using a ground-truth bbox prompt. Requires the optional SAM2 stack (not the gallery image, not the default headless install). No-op with a log line when SAM2 is not installed. Does not spawn from the gallery HTTP process.

nornir_build volumepath ScoreAnnotationCrops [-h] [-to [TO ...]]
                                             [-cc [CC ...]] -Output OUTPUTPATH
                                             [-Checkpoint CHECKPOINT]
                                             volumepath

Positional Arguments

volumepath

The path to the volume

Named Arguments

-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-Output

AnnotationCrops directory that already has annotation_crops.sqlite

-Checkpoint

SAM2 checkpoint path on the build machine

Example: nornir-build ScoreAnnotationCrops /data/volume -Output /data/volume/AnnotationCrops -Checkpoint /models/sam2.pt

ScoreStosGroupQuality

Compute full-pair ZNCC for each .stos in a group, write stos_quality.json, and set Transform PairZNCC attributes.

nornir_build volumepath ScoreStosGroupQuality [-h] [-to [TO ...]]
                                              [-cc [CC ...]]
                                              -StosGroup STOSGROUP
                                              -Downsample INPUTDOWNSAMPLE
                                              -StosMap STOSMAP
                                              [-MaxSide MAXSIDE] [-Force]
                                              volumepath

Positional Arguments

volumepath

The path to the volume

Named Arguments

-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-StosGroup

Stos group to score

Default: 'StosBrute'

-Downsample

Downsample level of the stos group

-StosMap

Stos map describing which pairs to score

Default: 'FinalStosMap'

-MaxSide

Clamp longest image side (pixels) before scoring

Default: 2048

-Force

Recompute pair ZNCC even when the cache entry is fresh

Default: False

SelectBestRegistrationChain

Create a new registration chain by examining the stos overlays produced by AssembleStosOverlays. If two registrations are possible for a section the overlay with the most overlap is chosen.

nornir_build volumepath SelectBestRegistrationChain [-h] [-to [TO ...]]
                                                    [-cc [CC ...]]
                                                    -StosGroup STOSGROUP
                                                    -Downsample INPUTDOWNSAMPLE
                                                    -InputStosMap INPUTSTOSMAP
                                                    [-OutputStosMap OUTPUTSTOSMAP]
                                                    volumepath

Positional Arguments

volumepath

The path to the volume

Named Arguments

-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-StosGroup

Stos group to assemble

Default: 'StosBrute'

-Downsample

Downsample level to assemble

-InputStosMap

Name assigned to generated stos map.

Default: 'PotentialRegistrationChain'

-OutputStosMap

Name assigned to generated stos map.

Default: 'FinalStosMap'

SetContrast

Set the contrast parameters for a filter

nornir_build volumepath SetContrast [-h] [-to [TO ...]] [-cc [CC ...]]
                                    [-Min MINVALUE] [-Max MAXVALUE]
                                    [-Gamma GAMMAVALUE] -Sections SECTIONS
                                    [-Channels CHANNELREGEX]
                                    [-Filters FILTERREGEX]
                                    volumepath

Positional Arguments

volumepath

The path to the volume

Named Arguments

-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-Min

Min intensity value, set to 0 in output

Default: NaN

-Max

Max intensity value, set to 1 in output

Default: NaN

-Gamma

Gamma adjustment

Default: NaN

-Sections

Section numbers to edit. Values are separated with commas and ranges are indicated by hyphens. Ex: ‘1,3,5-7’ == [1,3,5,6,7]

-Channels

Regular expression describing channels to be edited

Default: '*'

-Filters

Regular expression describing filters to be edited

Default: '*'

SetFilterLock

Toggle the locked flag for a filter. Locked filters will not have images recalculated.

nornir_build volumepath SetFilterLock [-h] [-to [TO ...]] [-cc [CC ...]]
                                      -Locked LOCKED -Sections SECTIONS
                                      [-Channels CHANNELREGEX]
                                      [-Filters FILTERREGEX]
                                      volumepath

Positional Arguments

volumepath

The path to the volume

Named Arguments

-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-Locked

Lock value, 0 = unlocked, 1 = locked

-Sections

Section numbers to edit. Values are separated with commas and ranges are indicated by hyphens. Ex: ‘1,3,5-7’ == [1,3,5,6,7]

-Channels

Regular expression describing channels to be edited

Default: '*'

-Filters

Regular expression describing filters to be edited

Default: '*'

SetFilterMaskName

Specify another filter in the same channel to use as a mask when using this filter.

nornir_build volumepath SetFilterMaskName [-h] [-to [TO ...]] [-cc [CC ...]]
                                          -InputFilter INPUTFILTER
                                          -MaskName NEWNAME
                                          volumepath

Positional Arguments

volumepath

The path to the volume

Named Arguments

-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-InputFilter

Existing filter name to rename (exact name match, not regex)

-MaskName

New Mask Name for filter name

SetMosaicLock

Toggle the locked flag for a .mosaic transform to prevent or enable regeneration.

nornir_build volumepath SetMosaicLock [-h] [-to [TO ...]] [-cc [CC ...]]
                                      -Locked LOCKED -Sections SECTIONS
                                      [-Channels CHANNELREGEX]
                                      -Transforms TRANSFORMREGEX
                                      volumepath

Positional Arguments

volumepath

The path to the volume

Named Arguments

-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-Locked

Lock value, 0 = unlocked, 1 = locked

-Sections

Section numbers to edit. Values are separated with commas and ranges are indicated by hyphens. Ex: ‘1,3,5-7’ == [1,3,5,6,7]

-Channels

Regular expression describing channels to be edited

Default: '*'

-Transforms

Regular expression describing transform names to be edited

SetPruneCutoff

Set the prune threshold for a filter. The new value will not update the volume until the Prune operation is run.

nornir_build volumepath SetPruneCutoff [-h] [-to [TO ...]] [-cc [CC ...]]
                                       -Value PRUNEVAL -Sections SECTIONS
                                       [-Channels CHANNELREGEX]
                                       [-Filters FILTERREGEX]
                                       volumepath

Positional Arguments

volumepath

The path to the volume

Named Arguments

-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-Value

Prune threshold to set

Default: 0

-Sections

Section numbers to edit. Values are separated with commas and ranges are indicated by hyphens. Ex: ‘1,3,5-7’ == [1,3,5,6,7]

-Channels

Regular expression describing channels to be edited

Default: '*'

-Filters

Regular expression describing filters to be edited

Default: '*'

SetTransformLock

Toggle the locked flag for a filter. Locked filters will not have images recalculated.

nornir_build volumepath SetTransformLock [-h] [-to [TO ...]] [-cc [CC ...]]
                                         -Locked LOCKED -Sections SECTIONS
                                         [-Channels CHANNELREGEX]
                                         [-Transform TRANSFORMREGEX]
                                         volumepath

Positional Arguments

volumepath

The path to the volume

Named Arguments

-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-Locked

Lock value, 0 = unlocked, 1 = locked

-Sections

Section numbers to edit. Values are separated with commas and ranges are indicated by hyphens. Ex: ‘1,3,5-7’ == [1,3,5,6,7]

-Channels

Regular expression describing channels to be edited

Default: '*'

-Transform

Name of the transform to lock/unlock

Default: '*'

ShadeCorrect

Brightfield microscopy shading correction. Uses the max tile intensity across all tiles to determine the shading gradient. Produces an inverted output filter with the shading subtracted.

nornir_build volumepath ShadeCorrect [-h] [-to [TO ...]] [-cc [CC ...]]
                                     [-Sections SECTIONS]
                                     [-Channels CHANNELSREGEX]
                                     [-Filters FILTERSREGEX]
                                     [-OutputFilter OUTPUTFILTER]
                                     -Correction {brightfield,darkfield}
                                     volumepath

Positional Arguments

volumepath

The path to the volume

Named Arguments

-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-Sections

Section numbers to process. If omitted all sections are processed. Values are separated with commas and ranges are indicated by hyphens. Ex: ‘1,3,5-7’ == [1,3,5,6,7]

-Channels

Regular expression describing channels to include, * processes all channels

Default: '*'

-Filters

Regular expression describing filters to include, * processes all filters

Default: '(?![M|m]ask)'

-OutputFilter

Prefix added to output filters

Default: 'ShadingCorrected'

-Correction

Possible choices: brightfield, darkfield

Brightfield images have a light background with darker features. Darkfield images have a dark background with light features.

Default: 'brightfield'

SliceToVolume

Created a group of slice-to-volume transforms from a group of slice-to-slice transforms

nornir_build volumepath SliceToVolume [-h] [-to [TO ...]] [-cc [CC ...]]
                                      [-Downsample STOVDOWNSAMPLE]
                                      -InputGroup STOVINPUTGROUP
                                      [-OutputGroup STOVOUTPUTGROUPNAME]
                                      [-InputMap INPUTMAP]
                                      [-OutputMap OUTPUTMAP] [-NoEnrichment]
                                      [-Tolerance TOLERANCE] [-NoLinearBlend]
                                      [-min_blend MIN_BLEND]
                                      [-linear_factor LINEAR_BLEND_FACTOR]
                                      [-max_blend MAX_BLEND]
                                      [-travel_limit TRAVEL_LIMIT]
                                      [-reblend_iterations REBLEND_ITERATIONS]
                                      [-reblend_tolerance REBLEND_TOLERANCE]
                                      [-no_rotation] [-mesh_rigid_linear]
                                      volumepath

Positional Arguments

volumepath

The path to the volume

Named Arguments

-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-Downsample

Downsample level to use for SliceToVolume

Default: 16

-InputGroup

Map describing which sections register to each other

Default: 'StosGrid'

-OutputGroup

Name of output group

Default: 'SliceToVolume'

-InputMap

Name of output group

Default: 'FinalStosMap'

-OutputMap

Name of output registration map. Defaults to -OutputGroup name if omitted.

-NoEnrichment

Do not add extra control points to slice-to-volume transforms to increase accuracy.

Default: True

-Tolerance

Maximum distance, at full resolution, between the expected and actual position of transformed triangle centroids. Above this value a control point is added at the centroid to increase transform accuracy.

Default: 64

-NoLinearBlend

Compose slice-to-volume transforms without per-section linear blend. Overrides -min_blend and -travel_limit pipeline defaults.

Default: False

-min_blend

Floor weight toward rigid linear blend during composition (0–1).

Default: 0.05

-linear_factor

Deprecated alias for -min_blend.

-max_blend

Cap per-point rigid blend weight during composition.

-travel_limit

Full-resolution distance scale for smooth per-point blend toward the rigid transform prediction during chain composition.

Default: 512

-reblend_iterations

Iterative linear-blend passes per transform composition. Use 1 for a single pass.

Default: 8

-reblend_tolerance

Stop re-blending when the maximum control-point movement falls below this distance (pixels at working resolution).

Default: 0.5

-no_rotation

Added for SEM volumes where it is certain there is no rotation from section to section, defaults to False

Default: False

-mesh_rigid_linear

Use rigid fit of accumulated B→C mesh for linear blend instead of composed rigid slice-to-slice chain.

Default: True

StosReport

Generate a web page containing a summary of the alignments between sections in a 3D volume

nornir_build volumepath StosReport [-h] [-to [TO ...]] [-cc [CC ...]]
                                   -StosGroup STOSGROUP [-Output OUTPUTPATH]
                                   volumepath

Positional Arguments

volumepath

The path to the volume

Named Arguments

-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-StosGroup

Stos group to pull images from

-Output

Name of report html file

Default: 'StosReport.html'

SyncValidationTimes

Walks filesystem-backed volume nodes and realigns ValidationTime to current mtimes so copied volumes do not look modified and trigger unnecessary pyramid rebuilds.

nornir_build volumepath SyncValidationTimes [-h] [-to [TO ...]] [-cc [CC ...]]
                                            [-dryrun]
                                            volumepath

Positional Arguments

volumepath

The path to the volume

Named Arguments

-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-dryrun

Report nodes that would change without updating ValidationTime

Default: False

Example: nornir-build SyncValidationTimes /data/volume

VolumeImage

Produces an assembled image for transforms in a stos group. If the transforms are slice-to-volume transforms the output should be registered into a volume. Note that using this function requires assembled images to exist at full resolution. If these do not exist see the MosaicToVolume pipeline.

nornir_build volumepath VolumeImage [-h] [-to [TO ...]] [-cc [CC ...]]
                                    [-InputGroup VOLUMEIMAGEGROUPNAME]
                                    [-InputDownsample VOLUMEIMAGEDOWNSAMPLE]
                                    volumepath

Positional Arguments

volumepath

The path to the volume

Named Arguments

-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-InputGroup

Name of stos group to create scaled version of, default = SliceToVolume

Default: 'SliceToVolume'

-InputDownsample

Downsample level of input stosgroup, default = 1

Default: 1

Examples:

nornir-build ImportIDoc /data/volume /data/idoc nornir-build -debug -computational_library cupy Mosaic /data/volume -Sections 1-10 nornir-build help Mosaic

nornir_buildmanager.build.BuildParserRoot() → ArgumentParser[source]
nornir_buildmanager.build.Execute(buildArgs=None)[source]

Run the nornir-build command line entrypoint.

The argv parser accepts canonical subcommand ordering and legacy test ordering that starts with volumepath.

nornir_buildmanager.build.ExecuteChain(buildArgs: list[str]) → None[source]

Run multiple pipelines sequentially in one process, separated by --then.

nornir_buildmanager.build.InitLogging(buildArgs)[source]

Initialize persistent logging for the current command invocation.

Logging writes through nornir_shared.misc.SetupLogging. When a volumepath is present, file logs go under <volumepath>/logs. -debug sets the level to DEBUG; otherwise WARN is used.

nornir_buildmanager.build.SetupLogging(LogToFile: bool = False, OutputPath: str | None = None, Level=None)[source]
Parameters:
  • LogToFile (bool) – True if logs should be saved to a file. Automatically set to true if OutputPath is not None

  • OutputPath (str) – Path to directory to use to save log files.

  • Level – Level of messages to write to log

class nornir_buildmanager.build.TaskTimer[source]

Bases: object

Helper class that allows us to manually record how long a given section of code took to execute

ElapsedString(task)[source]
property ElapsedTimes: dict[str, float]

Return a copy of recorded task wall times in seconds.

End(task, print_elapsed=True)[source]

Stop a timer for a task, print output if PrintElapsed is not explicitely set to False

Start(task)[source]
nornir_buildmanager.build.call_pipeline(args)[source]
nornir_buildmanager.build.call_recover_import_meta_data(args)[source]

Recover notes metadata from text files under the volume or an import directory.

This function checks for missing link elements in a volume and adds them back to the volume

nornir_buildmanager.build.call_repair_xml(args)[source]

Repair malformed VolumeData XML files with trailing content.

This migration-style repair targets older metadata where characters were written after the closing XML tag (primarily pre-Dec 2023 data sets).

nornir_buildmanager.build.init_computational_library(args: Namespace)[source]

Select CPU/GPU computation backend and export process environment.

Records the backend the build asked for in NORNIR_COMPUTATIONAL_LIBRARY_REQUESTED and updates nornir_imageregistration’s active backend, which sets NORNIR_COMPUTATIONAL_LIBRARY to the backend actually in effect.

The two can diverge: requesting cupy on a host whose CuPy runtime probe fails leaves requested=cupy / effective=numpy. Keeping both lets a build log show that a GPU run silently fell back to the CPU.

nornir_buildmanager.build.is_headless() → bool[source]
nornir_buildmanager.build.lowpriority()[source]

Set the priority of the process to below-normal. Copied from: http://stackoverflow.com/questions/1023038/change-process-priority-in-python-cross-platform

nornir_buildmanager.build.print_help(args)[source]

Pipeline and volume model modules

Note: Certain arguments support regular expressions. See the python re module for instructions on how to construct appropriate regular expressions.

Options available to all build commands. Specific pipelines extend this argument list.

usage: nornir_build volumepath [-h] [-debug] [-lowpriority] [-verbose]
                               [-computational_library {cupy,numpy,detect}]
                               [-no-delete]
                               {help,RecoverLinks,RecoverNotes,RepairXML,AddStos,AddToStosMap,AdjustContrast,AdoptVikingVolume,AlignSections,Assemble,AssembleStosOverlays,AssembleTiles,AssembleTilesFromImage,BuildImagePyramids,CalculateStosGroupWarpMetrics,Cleanup,CleanupStos,CopyStosGroup,CreateBlobFilter,CreateStosGroup,CreateVikingXML,ExportAnnotationCrops,ExportImages,ExportMetadata,ForceUpdateInputTransform,GenerateMosaicLayoutSVG,Histogram,ImportDM4,ImportIDoc,ImportImages,ImportMRC,ImportPMG,InvertFilter,LinearizeVolume,ListBlockStosMaps,ListDamagedSections,ListFilterContrast,ListGroupSectionMappings,ListMissingTilesets,ListPruneCutoff,ListStosGroups,ListStosMap,MarkSectionsDamaged,MarkSectionsUndamaged,Mosaic,MosaicNoTranslate,MosaicReport,MosaicToVolume,PrintContrast,Prune,RefineSectionAlignment,RefineSectionAlignment-IrTools,RemoveFromStosMap,RemoveStosGroup,RemoveTransform,RenameFilter,RepairAnnotationOverlays,RepairStosAngles,ReportVolumeBounds,ScaleVolumeTransforms,ScoreAnnotationCrops,ScoreStosGroupQuality,SelectBestRegistrationChain,SetContrast,SetFilterLock,SetFilterMaskName,SetMosaicLock,SetPruneCutoff,SetTransformLock,ShadeCorrect,SliceToVolume,StosReport,SyncValidationTimes,VolumeImage} ...

Named Arguments

-debug

If true any exceptions raised by pipelines are not handled.

Default: False

-lowpriority, -lp

Run the build with lower priority. The machine may be more responsive at the expense of much slower builds. 3x-5x slower in tests.

Default: False

-verbose

Log per-iterate pipeline progress (Iterate/Mapping dumps). Same as NORNIR_LOG_PIPELINE_PROGRESS=1. Independent of -debug.

Default: False

-computational_library

Possible choices: cupy, numpy, detect

If not specified, cupy will be used if a nVidia GPU is present. Otherwise, force cupy (GPU) or numpy (CPU) use.

Default: 'detect'

-no-delete

Skip all destructive Clean() and file removals; log what would have been deleted instead. Stages still run and missing outputs are still created.

Default: False

Commands

command

Possible choices: help, RecoverLinks, RecoverNotes, RepairXML, AddStos, AddToStosMap, AdjustContrast, AdoptVikingVolume, AlignSections, Assemble, AssembleStosOverlays, AssembleTiles, AssembleTilesFromImage, BuildImagePyramids, CalculateStosGroupWarpMetrics, Cleanup, CleanupStos, CopyStosGroup, CreateBlobFilter, CreateStosGroup, CreateVikingXML, ExportAnnotationCrops, ExportImages, ExportMetadata, ForceUpdateInputTransform, GenerateMosaicLayoutSVG, Histogram, ImportDM4, ImportIDoc, ImportImages, ImportMRC, ImportPMG, InvertFilter, LinearizeVolume, ListBlockStosMaps, ListDamagedSections, ListFilterContrast, ListGroupSectionMappings, ListMissingTilesets, ListPruneCutoff, ListStosGroups, ListStosMap, MarkSectionsDamaged, MarkSectionsUndamaged, Mosaic, MosaicNoTranslate, MosaicReport, MosaicToVolume, PrintContrast, Prune, RefineSectionAlignment, RefineSectionAlignment-IrTools, RemoveFromStosMap, RemoveStosGroup, RemoveTransform, RenameFilter, RepairAnnotationOverlays, RepairStosAngles, ReportVolumeBounds, ScaleVolumeTransforms, ScoreAnnotationCrops, ScoreStosGroupQuality, SelectBestRegistrationChain, SetContrast, SetFilterLock, SetFilterMaskName, SetMosaicLock, SetPruneCutoff, SetTransformLock, ShadeCorrect, SliceToVolume, StosReport, SyncValidationTimes, VolumeImage

Sub-commands

help

Show help for a specific command

nornir_build volumepath help [-h] [command_name]
Positional Arguments
command_name

Name of the command to show help for

RecoverNotes

Recover or update notes from *.txt files. With ImportDir, scan an IDoc-style raw-data tree and copy changed notes into matching volume sections.

nornir_build volumepath RecoverNotes [-h] [-save] volumepath [ImportDir]
Positional Arguments
volumepath

The path to the volume

ImportDir

Optional raw-data directory in IDoc import layout. When provided, notes.txt files from section folders are copied into matching volume sections.

Named Arguments
-save

Set this flag to save the VolumeData.xml files with the located linked elements included.

Default: False

RepairXML

Fixes an issue where XML files have extra characters after the closing tag. Should only apply to data before Dec 2023

nornir_build volumepath RepairXML [-h] volumepath
Positional Arguments
volumepath

The path to the volume

AddStos

Import a Slice-to-slice transformation to a StosGroup.

nornir_build volumepath AddStos [-h] [-to [TO ...]] [-cc [CC ...]]
                                -File INPUTSTOSFULLPATH [-Block BLOCKNAME]
                                -StosGroup STOSGROUP
                                -ControlSection CONTROLSECTION
                                -ControlChannel CONTROLCHANNEL
                                -ControlFilter CONTROLFILTER
                                -ControlDownsample CONTROLDOWNSAMPLE
                                -MappedSection MAPPEDSECTION
                                -MappedChannel MAPPEDCHANNEL
                                -MappedFilter MAPPEDFILTER
                                -MappedDownsample MAPPEDDOWNSAMPLE -Type TYPE
                                volumepath
Positional Arguments
volumepath

The path to the volume

Named Arguments
-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-File

Path to the .stos file to import

-Block

Block to create the StosGroup within

Default: 'TEM'

-StosGroup

Name of the StosGroup

-ControlSection

Control Section Number of the Stos Transform

-ControlChannel

Control Channel of the Stos Transform

-ControlFilter

Control Filter of image used for transform

-ControlDownsample

Downsample level of controlled section’s image

-MappedSection

Mapped Section Number of the Stos Transform

-MappedChannel

Mapped Channel of the Stos Transform

-MappedFilter

Mapped Filter of image used for transform

-MappedDownsample

Downsample level of mapped section’s image

-Type

Name of the StosGroup

AddToStosMap

List all SliceToSlice mappings within a stos map

nornir_build volumepath AddToStosMap [-h] [-to [TO ...]] [-cc [CC ...]]
                                     [-Block BLOCKNAME] -Name STOSMAPNAME
                                     -ControlSection CONTROLSECTION
                                     -MappedSection MAPPEDSECTION
                                     volumepath
Positional Arguments
volumepath

The path to the volume

Named Arguments
-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-Block

Block to create the StosGroup within

Default: 'TEM'

-Name

Name of the StosMap

-ControlSection

Control Section Number

-MappedSection

Mapped Section Number

AdjustContrast

Creates a new filter with adjusted contrast. The cutoffs can be adjusted within the meta-data by altering the AutoLevelHint element of the input filters volume.xml meta-data file.

nornir_build volumepath AdjustContrast [-h] [-to [TO ...]] [-cc [CC ...]]
                                       [-Sections SECTIONS]
                                       [-Channels CHANNELSREGEX]
                                       [-Gamma GAMMA] [-MinCutoff MINCUTOFF]
                                       [-MaxCutoff MAXCUTOFF]
                                       -InputFilter INPUTFILTER
                                       [-OutputFilter OUTPUTFILTER]
                                       [-OutputBpp OUTPUTBPP]
                                       -InputTransform INPUTTRANSFORM
                                       volumepath
Positional Arguments
volumepath

The path to the volume

Named Arguments
-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-Sections

Section numbers to process. If omitted all sections are processed. Values are separated with commas and ranges are indicated by hyphens. Ex: ‘1,3,5-7’ == [1,3,5,6,7]

-Channels

Regular expression describing channels to include, * processes all channels

Default: '*'

-Gamma

Gamma value for intensity auto-level

-MinCutoff

Min pixel intensity cutoff as a percentage, 0 to 100

Default: 0.1

-MaxCutoff

Max pixel intensity cutoff as a percentage, 0 to 100. Specifying ‘1’ puts the cutoff at 99% of the maximum pixel intensity value.

Default: 0.5

-InputFilter

Filter to draw images from

Default: 'Raw8'

-OutputFilter

Filter to draw images from

Default: 'Leveled'

-OutputBpp

Bits-per-pixel of output filter images

-InputTransform

Mosaic transform to prune. The transform provides the list of tiles in the mosaic.

Default: 'Prune'

AdoptVikingVolume

Moves and renames files from a Viking volume clone (RC1_Original) into TEM/NNNN/TEM with locked mosaics, stos, and filters. Image bytes are not rewritten. Do not point this at the live Rabbit volume.

nornir_build volumepath AdoptVikingVolume [-h] [-to [TO ...]] [-cc [CC ...]]
                                          [-Sections SECTIONS] [-DryRun]
                                          volumepath ImportDir
Positional Arguments
volumepath

The path to the volume

ImportDir

Viking-layout source volume (the RC1_Original clone). Must not be Rabbit or a folder still named RC1.

Named Arguments
-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-Sections

Section numbers to adopt. If omitted all sections are adopted. Values are separated with commas and ranges are indicated by hyphens. Ex: ‘1,3,5-7’ == [1,3,5,6,7]

-DryRun

Print planned moves without moving files or writing filter/transform nodes.

Default: False

Example: nornir-build AdoptVikingVolume Y:VolumesRC1 Y:VolumesRC1_Original -Sections 1,2,47 -DryRun

AlignSections

Builds section-to-section mappings and computes brute alignment transforms across adjacent sections.

nornir_build volumepath AlignSections [-h] [-to [TO ...]] [-cc [CC ...]]
                                      [-Center CENTER]
                                      [-NumAdjacentSections NUMADJACENTSECTIONS]
                                      [-AngleRange ANGLESEARCHRANGE]
                                      [-Channels CHANNELSREGEX]
                                      [-Filters FILTERSREGEX] [-UseMasks]
                                      -Downsample STOSBRUTEDOWNSAMPLE
                                      [-OutputStosMap OUTPUTSTOSMAP]
                                      [-NoFlipCheck]
                                      [-Method {SliceToSliceMethod.BruteForce,SliceToSliceMethod.LogPolar}]
                                      volumepath
Positional Arguments
volumepath

The path to the volume

Named Arguments
-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-Center

Center section of the volume. Defaults to center if unspecified. The first run center is saved in meta-data and re-used on later runs.

-NumAdjacentSections

Number of adjacent sections to attempt registration with.

Default: 1

-AngleRange

Range of angles to check in degrees not radians

Default: ````

-Channels

Regular expression describing channels to be aligned

Default: '*'

-Filters

Regular expression describing filters to be aligned

Default: '(?![M|m]ask)'

-UseMasks

Use masks for images if they are available. Masked areas are replaced with random noise for alignment purposes.

Default: False

-Downsample

Amount to downsample input images before attempting alignment. Images are padded to the next power of two for the FFT. Large images, roughly greater than 2048x2048, can be very slow.

Default: 1

-OutputStosMap

Name assigned to generated stos map.

Default: 'PotentialRegistrationChain'

-NoFlipCheck

Do not check for flipped sections. Use this option if it is impossible for images to be flipped. Doubles execution speed.

Default: False

-Method

Possible choices: SliceToSliceMethod.BruteForce, SliceToSliceMethod.LogPolar

Method to use for intitial registration

Default: SliceToSliceMethod.LogPolar

Example: nornir-build AlignSections /data/volume -Downsample 8 -Channels .* -Filters Raw8 -OutputStosMap PotentialRegistrationChain

Assemble

Creates an assembled image from a transform and filter. Optionally creates a new channel for output.

nornir_build volumepath Assemble [-h] [-to [TO ...]] [-cc [CC ...]]
                                 [-Sections SECTIONS] [-Downsample LEVELS]
                                 [-NoInterlace] [-Channels CHANNELREGEX]
                                 [-ChannelPrefix OUTPUTCHANNELPREFIX]
                                 [-Filters FILTERREGEX]
                                 [-Transform TRANSFORMNAME] [-Crop CROPBOX]
                                 [-ext IMAGE_EXT]
                                 volumepath
Positional Arguments
volumepath

The path to the volume

Named Arguments
-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-Sections

Section numbers to process. If omitted all sections are processed. Values are separated with commas and ranges are indicated by hyphens. Ex: ‘1,3,5-7’ == [1,3,5,6,7]

-Downsample

Comma separated list of downsample levels for assembling images. If output is desired only one downsample level can be used.

Default: 1

-NoInterlace

Setting this flag skips the interlace step after assemble. Interlaced images load faster on web pages, but are larger than non-interlaced images.

Default: True

-Channels

Regular expression describing channels to be assembled

Default: '*'

-ChannelPrefix

Create a new channel for the output with this prefix and the name of the input.

Default: ''

-Filters

Regular expression describing filters to be assembled

Default: '(?![M|m]ask)'

-Transform

Directory to move assembled images to

Default: 'Grid'

-Crop

Bounding box of region to assemble. Default is no cropping. Form is MinX,MinY,MaxX,MaxY with no spaces.

Default: ````

-ext

Format to save, default is png format. Use npy for Numpy arrays.

Default: 'png'

AssembleStosOverlays

Assembles registered images for .stos files in a group. Typically this is done so quality of registration at that stage can be assessed.

nornir_build volumepath AssembleStosOverlays [-h] [-to [TO ...]]
                                             [-cc [CC ...]]
                                             -StosGroup STOSGROUP
                                             -Downsample INPUTDOWNSAMPLE
                                             -StosMap STOSMAP
                                             volumepath
Positional Arguments
volumepath

The path to the volume

Named Arguments
-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-StosGroup

Stos group to assemble

Default: 'StosBrute'

-Downsample

Downsample level to assemble

-StosMap

Name assigned to generated stos map.

Default: 'FinalStosMap'

AssembleTiles

Build small full-resolution tiles, usually 256x256, that allow regions of the mosaic to be rapidly loaded

nornir_build volumepath AssembleTiles [-h] [-to [TO ...]] [-cc [CC ...]]
                                      [-Sections SECTIONS]
                                      [-Channels CHANNELREGEX]
                                      [-Filters FILTERREGEX]
                                      [-Transform TRANSFORMNAME]
                                      [-HighestDownsample HIGHESTDOWNSAMPLE]
                                      [-Shape SHAPE]
                                      [-MaxWorkingImageArea MAX_TEMP_IMAGE_AREA]
                                      [-IgnoreStale]
                                      volumepath
Positional Arguments
volumepath

The path to the volume

Named Arguments
-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-Sections

Section numbers to process. If omitted all sections are processed. Values are separated with commas and ranges are indicated by hyphens. Ex: ‘1,3,5-7’ == [1,3,5,6,7]

-Channels

Regular expression describing channels to be assembled

Default: '*'

-Filters

Regular expression describing filters to be assembled

Default: '(?![M|m]ask)'

-Transform

Transform defining images into mosaic

Default: 'Grid'

-HighestDownsample

Highest level downsample to generate. Defaults to the level required to show entire section on one tile.

-Shape

The size the tiles passed as a comma-delimited pair of integers. For example 256,512. If a single number is passed it is used for both dimensions

Default: 512,512

-MaxWorkingImageArea

Determines the amount of memory the system should use to generate the tiles. Suggested value is total system memory in bytes divided by four

-IgnoreStale

Setting this flag skips testing existing tiles to ensure they were created after the input transform.

Default: False

AssembleTilesFromImage

Build small full-resolution tiles, usually 256x256, that allow regions of the mosaic to be rapidly loaded. Uses the filter image as source instead of transforms.

nornir_build volumepath AssembleTilesFromImage [-h] [-to [TO ...]]
                                               [-cc [CC ...]]
                                               [-Sections SECTIONS]
                                               [-Channels CHANNELREGEX]
                                               [-Filters FILTERREGEX]
                                               [-HighestDownsample HIGHESTDOWNSAMPLE]
                                               [-Shape SHAPE]
                                               volumepath
Positional Arguments
volumepath

The path to the volume

Named Arguments
-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-Sections

Section numbers to process. If omitted all sections are processed. Values are separated with commas and ranges are indicated by hyphens. Ex: ‘1,3,5-7’ == [1,3,5,6,7]

-Channels

Regular expression describing channels to be assembled

Default: '*'

-Filters

Regular expression describing filters to be assembled

Default: '(?![M|m]ask)'

-HighestDownsample

Highest level downsample to generate. Defaults to the level required to show entire section on one tile.

-Shape

The size the tiles passed as a comma-delimited pair of integers. For example 256,512. If a single number is passed it is used for both dimensions

Default: 512,512

BuildImagePyramids

Rebuild derived ImageSet pyramid levels when a parent image checksum is stale. Does not assemble from tiles. Use after Assemble or to repair coarser levels left behind.

nornir_build volumepath BuildImagePyramids [-h] [-to [TO ...]] [-cc [CC ...]]
                                           [-Sections SECTIONS]
                                           [-Channels CHANNELREGEX]
                                           [-Filters FILTERREGEX]
                                           [-Downsample LEVELS] [-NoInterlace]
                                           volumepath
Positional Arguments
volumepath

The path to the volume

Named Arguments
-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-Sections

Section numbers to process. If omitted all sections are processed. Values are separated with commas and ranges are indicated by hyphens. Ex: ‘1,3,5-7’ == [1,3,5,6,7]

-Channels

Regular expression describing channels to process

Default: '*'

-Filters

Regular expression describing filters to process. Default includes Mask filters.

Default: '*'

-Downsample

Comma separated downsample levels to consider together with existing ImageSet levels. If omitted, all existing levels are used.

Default: ''

-NoInterlace

Setting this flag skips the interlace step after shrink. Interlaced images load faster on web pages, but are larger than non-interlaced images.

Default: True

CalculateStosGroupWarpMetrics

Creates images indicating the amount of warping present in each .stos file in a group. Typically this is done so quality of registration at that stage can be assessed.

nornir_build volumepath CalculateStosGroupWarpMetrics [-h] [-to [TO ...]]
                                                      [-cc [CC ...]]
                                                      -StosGroup STOSGROUP
                                                      -Downsample INPUTDOWNSAMPLE
                                                      -StosMap STOSMAP
                                                      [-MaxAngle MAXREPORTEDANGLE]
                                                      [-RenderToTargetSection]
                                                      volumepath
Positional Arguments
volumepath

The path to the volume

Named Arguments
-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-StosGroup

Stos group to assemble

Default: 'StosBrute'

-Downsample

Downsample level to assemble

-StosMap

Name assigned to generated stos map.

Default: 'FinalStosMap'

-MaxAngle

Maximum angle value, in degrees, in output image heatmaps. Defaults to max angle found for each section. Specify a value to ensure consistent heatmap ranges for each transform. 15-30 degrees is usually a reasonable value.

-RenderToTargetSection

Indicates whether the image is rendered in the source or target section coordinates. Rendering to source will result in a square image. Rendering to target is better for transforms to volume space.

Default: True

Cleanup

Clean common errors from the volume meta-data

nornir_build volumepath Cleanup [-h] [-to [TO ...]] [-cc [CC ...]]
                                [-Sections SECTIONS]
                                volumepath
Positional Arguments
volumepath

The path to the volume

Named Arguments
-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-Sections

Section numbers to edit. Values are separated with commas and ranges are indicated by hyphens. Ex: ‘1,3,5-7’ == [1,3,5,6,7]

CleanupStos

Clean common errors in section mappings

nornir_build volumepath CleanupStos [-h] [-to [TO ...]] [-cc [CC ...]]
                                    volumepath
Positional Arguments
volumepath

The path to the volume

Named Arguments
-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

CopyStosGroup

Create a SliceToSlice transform group

nornir_build volumepath CopyStosGroup [-h] [-to [TO ...]] [-cc [CC ...]]
                                      -Input SOURCEGROUPNAME
                                      -Output TARGETGROUPNAME
                                      [-Block BLOCKNAME]
                                      [-Downsample DOWNSAMPLE]
                                      volumepath
Positional Arguments
volumepath

The path to the volume

Named Arguments
-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-Input

Source StosGroup to copy transforms from.

-Output

Target StosGroup to copy transform to.

-Block

Block to create the StosGroup within

Default: 'TEM'

-Downsample

Downsample level of stos files

Default: 1

CreateBlobFilter

Create a blob filter from an input filter. Blobbing can make brute slice-to-slice alignment more reliable for downsampled mosaics with fine textures.

nornir_build volumepath CreateBlobFilter [-h] [-to [TO ...]] [-cc [CC ...]]
                                         [-Sections SECTIONS]
                                         [-Channels CHANNELREGEX]
                                         -InputFilter INPUTFILTER
                                         [-Levels BLOBDOWNSAMPLELEVELS]
                                         [-Radius BLOBRADIUS]
                                         [-Median BLOBMEDIAN] [-Max BLOBMAX]
                                         [-OutputFilter OUTPUTFILTERNAME]
                                         volumepath
Positional Arguments
volumepath

The path to the volume

Named Arguments
-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-Sections

Section to execute blob on. Values are separated with commas and ranges are indicated by hyphens. Ex: ‘1,3,5-7’ == [1,3,5,6,7]

-Channels

Regular expression describing channels to be assembled

Default: '*'

-InputFilter

Name of filter to create blob filter for

Default: 'Leveled'

-Levels

Downsample levels to be blobbed

Default: 1

-Radius

Radius to calculate variance within

Default: 9

-Median

Median filter radius for input

Default: 7

-Max

Max variance before cropping

Default: 3

-OutputFilter

Prefix added to created filters

Default: 'Blob'

CreateStosGroup

Create a SliceToSlice transform group

nornir_build volumepath CreateStosGroup [-h] [-to [TO ...]] [-cc [CC ...]]
                                        -StosGroup STOSGROUP
                                        [-Block BLOCKNAME]
                                        [-Downsample DOWNSAMPLE]
                                        volumepath
Positional Arguments
volumepath

The path to the volume

Named Arguments
-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-StosGroup

Name of the StosGroup to create

-Block

Block to create the StosGroup within

Default: 'TEM'

-Downsample

Downsample level of stos files

Default: 1

CreateVikingXML

Exports volume metadata and image references into a VikingXML manifest for Viking clients.

nornir_build volumepath CreateVikingXML [-h] [-to [TO ...]] [-cc [CC ...]]
                                        [-StosGroup STOSGROUP]
                                        [-StosMap STOSMAP] [-Host HOST]
                                        -OutputFile OUTPUTFILE
                                        volumepath
Positional Arguments
volumepath

The path to the volume

Named Arguments
-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-StosGroup

Stos group to include (repeat for multiple groups). If not specified only unregistered mosaics are included.

-StosMap

Slice-to-slice mapping of transforms. If not specified only unregistered mosaics are included.

-Host

Url of volume, overrides the about.xml settings

-OutputFile

Name of file to write .VikingXML is appended to name automatically

Example: nornir-build CreateVikingXML /data/volume -OutputFile MyVolume -StosMap FinalStosMap -StosGroup Grid32 -StosGroup SliceToVolume1

ExportAnnotationCrops

Ingests Locations via -OData or -Geometries, then writes lossless PNG crops, 1-bit masks, COCO RLE JSON, and optional overlays. Does not modify VolumeData.xml.

nornir_build volumepath ExportAnnotationCrops [-h] [-to [TO ...]]
                                              [-cc [CC ...]] [-OData ODATA]
                                              [-Geometries GEOMETRIES]
                                              [-ODataFilter ODATAFILTER]
                                              -Output OUTPUTPATH
                                              [-Channels CHANNELS]
                                              [-Filters FILTERS]
                                              [-Downsample DOWNSAMPLE]
                                              [-Exporter EXPORTER] [-Pad PAD]
                                              [-MaxTexture MAXTEXTURE]
                                              [-MaxTiles MAXTILES]
                                              [-MinProcessPixels MINPROCESSPIXELS]
                                              [-Workers WORKERS]
                                              [-MaskWorkers MASKWORKERS]
                                              [-StageTiles STAGETILES]
                                              [-Sections SECTIONS]
                                              [-IncludeOffEdge] [-Force]
                                              [-RefreshOData]
                                              [-FailMissingTileset]
                                              [-NoOverlay] [-Cleanup]
                                              volumepath
Positional Arguments
volumepath

The path to the volume

Named Arguments
-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-OData

Connectome OData V4 service root. Exactly one of -OData or -Geometries is required.

-Geometries

Saved OData Locations dump (JSONL, {value:[]}, or concatenated page documents). Exactly one of -OData or -Geometries is required.

-ODataFilter

Override $filter only. Default selects closed polygons on Cell types including subtypes.

-Output

Directory for PNG crops, JSON, masks, overlays, and _work cache

-Channels

Regular expression for the channel that owns the tileset

Default: 'TEM'

-Filters

Regular expression for the filter that owns the tileset

Default: 'Leveled'

-Downsample

Tileset downsample to train at. With -Exporter tiled, masks that do not fit in one MaxTexture crop are split instead of coarsened.

Default: 1

-Exporter

Crop placement. tiled (default) keeps -Downsample and splits on the half-step lattice. legacy coarsens D until the mask fits one crop and never splits.

Default: 'tiled'

-Pad

Mosaic pixels added to each bbox side. Default is 1.

Default: 1

-MaxTexture

Max pixels per crop axis. Default is 1024.

-MaxTiles

Override floor(MaxTexture / tile dim) for the snapped tile window

-MinProcessPixels

Retained for compatibility. Does not change the training downsample.

Default: 16

-Workers

Stitch PNG encode process-pool size. Default is CPU count. Tile reads use a thread pool sized from CPU count; column bands size themselves from RAM.

-MaskWorkers

Mask rasterize process-pool size. Default is CPU count.

-StageTiles

Scratch root for NAS tile copies. Default is /tmp/nornir-stage-tiles/{volume}/z{section}. Override with a local Linux path (not a Windows/CIFS mount). Cleared after each section.

-Sections

Section numbers to process. Omitted means every Z that has geometries.

-IncludeOffEdge

Keep OffEdge locations. They are skipped by default.

Default: False

-Force

Full rebuild: refetch OData MosaicShape and restitch every crop even when watermarks match.

Default: False

-RefreshOData

Refetch OData MosaicShape into Output/_work, then update masks and JSON (and restitch only where crop windows changed). Unchanged crops are skipped.

Default: False

-FailMissingTileset

Fail instead of skipping a section whose filter has no Tileset/level.

Default: False

-NoOverlay

Skip QA overlay PNGs (TEM + Viking HCL hue, TEM luma). SAM2 does not use them.

Default: False

-Cleanup

Audit and repair corrupt AnnotationCrops products. Does not ingest OData or restitch.

Default: False

Example: nornir-build ExportAnnotationCrops /data/volume -OData http://host/odata -Output /data/sam2 -Channels TEM -Filters Leveled

ExportImages

Copies images of sections to an output directory

nornir_build volumepath ExportImages [-h] [-to [TO ...]] [-cc [CC ...]]
                                     [-Channels CHANNELREGEX]
                                     [-Filters FILTERREGEX]
                                     [-Downsample DOWNSAMPLE]
                                     [-Output OUTPUTPATH]
                                     volumepath
Positional Arguments
volumepath

The path to the volume

Named Arguments
-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-Channels

Regular expression describing channels to be assembled

Default: '*'

-Filters

Regular expression describing filters to be assembled

Default: '(?![M|m]ask)'

-Downsample

Downsample output images by this factor

Default: 1

-Output

Directory to move assembled images to

ExportMetadata

Export all meta-data to a single file

nornir_build volumepath ExportMetadata [-h] [-to [TO ...]] [-cc [CC ...]]
                                       [-Output OUTPUTPATH]
                                       volumepath
Positional Arguments
volumepath

The path to the volume

Named Arguments
-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-Output

Full path of output xml file, defaults to VolumeData.SingleFileBackup.xml in the Volume directory.

ForceUpdateInputTransform

Tells a transform to find its input transform by name, and update its input transform checksum to the current input transform’s checksum. Used is very rare cases where a change adjusts the checksum of an input transform but the content is the same and does not require rebuilding an entire chain of transforms.

nornir_build volumepath ForceUpdateInputTransform [-h] [-to [TO ...]]
                                                  [-cc [CC ...]]
                                                  -Sections SECTIONS
                                                  [-Channels CHANNELREGEX]
                                                  [-Transform TRANSFORMREGEX]
                                                  volumepath
Positional Arguments
volumepath

The path to the volume

Named Arguments
-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-Sections

Section numbers to edit. Values are separated with commas and ranges are indicated by hyphens. Ex: ‘1,3,5-7’ == [1,3,5,6,7]

-Channels

Regular expression describing channels to be edited

Default: '*'

-Transform

Name of the transform to lock/unlock

Default: '*'

GenerateMosaicLayoutSVG

Generates SVG files showing the layout of a given transform

nornir_build volumepath GenerateMosaicLayoutSVG [-h] [-to [TO ...]]
                                                [-cc [CC ...]]
                                                [-Sections SECTIONS]
                                                [-Channels CHANNELSREGEX]
                                                [-Downsample DOWNSAMPLE]
                                                [-Filter INPUTFILTERNAME]
                                                -Transform INPUTTRANSFORMNAME
                                                [-OutputFilename OUTPUTFILENAME]
                                                [-MinOverlap MIN_OVERLAP]
                                                [-IncludeDiagonalOverlaps]
                                                [-ShowFeatureScores]
                                                volumepath
Positional Arguments
volumepath

The path to the volume

Named Arguments
-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-Sections

Section numbers to process. If omitted all sections are processed. Values are separated with commas and ranges are indicated by hyphens. Ex: ‘1,3,5-7’ == [1,3,5,6,7]

-Channels

Regular expression describing channels to include, * processes all channels

Default: '*'

-Downsample

Downsample level to use for ir-tools

-Filter

Filter to use for layouts

-Transform

Name of the input transform

Default: 'Prune'

-OutputFilename

Prefix of output image.

Default: 'Layout'

-MinOverlap

Minimum amount of overlap tiles must have to contribute to the final mosaic.

Default: 0.05

-IncludeDiagonalOverlaps

Setting this flag includes tiles that only have a diagonal overlap, that is the center of the tile is outside the X/Y boundaries of the paired tile. This can introduce extra calculation time and possibly noise but be helpful if the tiles moved considerably during capture or are not laid out on a grid.

Default: True

-ShowFeatureScores

Setting this flag multiplies the alignment weights by the feature score of the overlapping region in the translate phase. This can sometimes reduce the impact of large featureless areas but seems to introduce noise in many other cases.

Default: False

Histogram

Calculates the histogram from all tiles in a mosaic

nornir_build volumepath Histogram [-h] [-to [TO ...]] [-cc [CC ...]]
                                  [-Sections SECTIONS]
                                  [-Channels CHANNELSREGEX]
                                  [-Filters FILTERSREGEX]
                                  -InputTransform INPUTTRANSFORM
                                  [-Downsample DOWNSAMPLE]
                                  volumepath
Positional Arguments
volumepath

The path to the volume

Named Arguments
-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-Sections

Section numbers to process. If omitted all sections are processed. Values are separated with commas and ranges are indicated by hyphens. Ex: ‘1,3,5-7’ == [1,3,5,6,7]

-Channels

Regular expression describing channels to include, * processes all channels

Default: '*'

-Filters

Regular expression describing filters to include, * processes all filters

Default: '(?![M|m]ask)'

-InputTransform

The transform provided the list of tiles in the mosaic.

Default: 'Prune'

-Downsample

Use downsampled tiles for faster histogram calculation

Default: 1

ImportDM4

Imports DM4 tile datasets into channels/sections and records overlap metadata for mosaic registration.

nornir_build volumepath ImportDM4 [-h] [-to [TO ...]] [-cc [CC ...]]
                                  [-ext EXTENSION] [-Sections SECTIONS]
                                  [-overlap TILE_OVERLAP]
                                  volumepath ImportDir
Positional Arguments
volumepath

The path to the volume

ImportDir

Directory to import from

Named Arguments
-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-ext

Extension of digital micrograph version 4 files, default is dm4

Default: 'dm4'

-Sections

Section numbers to process. If omitted all sections are processed. Values are separated with commas and ranges are indicated by hyphens. Ex: ‘1,3,5-7’ == [1,3,5,6,7]

-overlap

Overlap of tiles as a percentage, either a single value or a comma-delimited pair (X%,Y%).ntex: 15 would be a 15 overlap on both axis.ntex: 10,20 would be a 10% X overlap and 20% Y overlap.

Example: nornir-build ImportDM4 /data/volume /data/dm4 -Sections 1-20 -overlap 10,20

ImportIDoc

Imports SerialEM IDOC metadata and tile images into VolumeData.xml sections/channels. Use this as the normal first step for IDOC datasets before prune/mosaic alignment.

nornir_build volumepath ImportIDoc [-h] [-to [TO ...]] [-cc [CC ...]]
                                   [-ext EXTENSION] [-Min MINVALUE]
                                   [-Max MAXVALUE] [-Sections SECTIONS]
                                   [-CameraBpp CAMERABPP]
                                   volumepath ImportDir
Positional Arguments
volumepath

The path to the volume

ImportDir

Directory to import from. The .idoc files in subdirectories should be named with the desired section number after import. i.e. 0005.idoc to import the file as section #5.

Named Arguments
-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-ext

Extension of idoc files, default is idoc

Default: '*.idoc'

-Min

Min intensity cutoff. A value from 0.0 to 1.0

Default: 0.0001

-Max

Max intensity cutoff. A value from 0.0 to 1.0

Default: 0.9999

-Sections

Section numbers to process. If omitted all sections are processed. Values are separated with commas and ranges are indicated by hyphens. Ex: ‘1,3,5-7’ == [1,3,5,6,7]

-CameraBpp

The actual bits-per-pixel of the camera. Limits the range of image histograms being expanded beyond reason due to errors in input image data or meta-data.

Example: nornir-build ImportIDoc /data/volume /data/idoc -Sections 1-10 -CameraBpp 14

ImportImages

Import single images that represent an entire section in a volume

nornir_build volumepath ImportImages [-h] [-to [TO ...]] [-cc [CC ...]]
                                     -Scale SCALEVALUEINNM [-ext EXTENSION]
                                     volumepath ImportDir
Positional Arguments
volumepath

The path to the volume

ImportDir

Directory to import from

Named Arguments
-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-Scale

Pixel size in nanometers

-ext

Extension of image files, default is png

Default: 'png'

ImportMRC

Import SerialEM MRC files into a volume.

nornir_build volumepath ImportMRC [-h] [-to [TO ...]] [-cc [CC ...]]
                                  [-ext EXTENSION] [-Min MINVALUE]
                                  [-Max MAXVALUE] [-CameraBpp CAMERABPP]
                                  volumepath ImportDir
Positional Arguments
volumepath

The path to the volume

ImportDir

Directory to import from. The .mrc files in subdirectories should be named with the desired section number after import. i.e. 0005.mrc to import the file as section #5.

Named Arguments
-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-ext

Extension of mrc files, default is mrc

Default: 'mrc'

-Min

Min intensity cutoff. A value from 0.0 to 1.0

Default: 0.0001

-Max

Max intensity cutoff. A value from 0.0 to 1.0

Default: 0.9999

-CameraBpp

The actual bits-per-pixel of the camera. Limits the range of image histograms being expanded beyond reason due to errors in input image data or meta-data.

ImportPMG

Imports PMG files named with section/channel metadata into a volume. Use -Scale to provide nanometers-per-pixel for downstream geometry and reporting.

nornir_build volumepath ImportPMG [-h] [-to [TO ...]] [-cc [CC ...]]
                                  -Scale SCALEVALUEINNM [-ext EXTENSION]
                                  volumepath ImportDir
Positional Arguments
volumepath

The path to the volume

ImportDir

Directory to import from. The PMG file should follow this format: Slide#_Block#_Section#_Initials_Mag_Spot_Probe. However only Section and Probe are used as the section number and channel name respectively. The rest is stored as meta-data.

Named Arguments
-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-Scale

Pixel size in nanometers

-ext

Extension of pmg files, default is pmg

Default: 'pmg'

Example: nornir-build ImportPMG /data/volume /data/pmg -Scale 4.0

InvertFilter

Produce a new filter, inverted from the input

nornir_build volumepath InvertFilter [-h] [-to [TO ...]] [-cc [CC ...]]
                                     [-Sections SECTIONS]
                                     [-Channels CHANNELSREGEX]
                                     -InputFilter FILTERSREGEX
                                     -OutputFilter OUTPUTFILTER
                                     volumepath
Positional Arguments
volumepath

The path to the volume

Named Arguments
-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-Sections

Section numbers to process. If omitted all sections are processed. Values are separated with commas and ranges are indicated by hyphens. Ex: ‘1,3,5-7’ == [1,3,5,6,7]

-Channels

Regular expression describing channels to include, * processes all channels

Default: '*'

-InputFilter

The filter to invert

-OutputFilter

Prefix added to output filters

Default: 'Inverted'

LinearizeVolume

Undocumented

nornir_build volumepath LinearizeVolume [-h] [-to [TO ...]] [-cc [CC ...]]
                                        -InputGroup INPUTGROUPNAME
                                        -InputDownsample INPUTDOWNSAMPLE
                                        -OutputGroup OUTPUTGROUPNAME
                                        [-min_blend MIN_BLEND]
                                        [-linear_factor LINEAR_BLEND_FACTOR]
                                        [-max_blend MAX_BLEND]
                                        [-travel_limit TRAVEL_LIMIT]
                                        [-reblend_iterations REBLEND_ITERATIONS]
                                        [-reblend_tolerance REBLEND_TOLERANCE]
                                        [-no_rotation] [-workers WORKERS]
                                        volumepath
Positional Arguments
volumepath

The path to the volume

Named Arguments
-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-InputGroup

Name of stos group to linearize

-InputDownsample

Downsample level of input stosgroup

-OutputGroup

Name of the output stos group

-min_blend

Floor weight toward rigid linear blend (0–1). Uniform when -travel_limit is omitted.

Default: 0.05

-linear_factor

Deprecated alias for -min_blend.

-max_blend

Cap per-point rigid blend weight (0–1). Defaults to min_blend without travel_limit, else 0.9.

-travel_limit

Full-resolution distance scale for smooth per-point blend toward the rigid transform prediction.

Default: 512

-reblend_iterations

Iterative linear-blend passes per transform composition. Use 1 for a single pass.

Default: 8

-reblend_tolerance

Stop re-blending when the maximum control-point movement falls below this distance (pixels at working resolution).

Default: 0.5

-no_rotation

Added for SEM volumes where it is certain there is no rotation from section to section, defaults to False

Default: False

-workers

Parallel worker count for per-transform linear blend. Defaults to CPU count; use 1 for serial.

ListBlockStosMaps

List all SliceToSlice maps in a block

nornir_build volumepath ListBlockStosMaps [-h] [-to [TO ...]] [-cc [CC ...]]
                                          [-Block BLOCKNAME]
                                          volumepath
Positional Arguments
volumepath

The path to the volume

Named Arguments
-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-Block

Name of block

Default: 'TEM'

ListDamagedSections

Print a list of all damaged sections. Damaged sections are never used as control sections when chaining slice-to-slice transforms together to build slice-to-volume transforms

nornir_build volumepath ListDamagedSections [-h] [-to [TO ...]] [-cc [CC ...]]
                                            [-Block BLOCKREGEX]
                                            volumepath
Positional Arguments
volumepath

The path to the volume

Named Arguments
-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-Block

Regular expression describing blocks to include, * processes all blocks

Default: '*'

ListFilterContrast

Print a list of the contrast settings used for all sections.

nornir_build volumepath ListFilterContrast [-h] [-to [TO ...]] [-cc [CC ...]]
                                           [-Sections SECTIONS]
                                           [-Channels CHANNELSREGEX]
                                           [-Filters FILTERSREGEX]
                                           volumepath
Positional Arguments
volumepath

The path to the volume

Named Arguments
-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-Sections

Section numbers to process. If omitted all sections are processed. Values are separated with commas and ranges are indicated by hyphens. Ex: ‘1,3,5-7’ == [1,3,5,6,7]

-Channels

Regular expression describing channels to include, * processes all channels

Default: '*'

-Filters

Regular expression describing filters to include, * processes all filters

Default: '(?![M|m]ask)'

ListGroupSectionMappings

List all SliceToSlice transform groups

nornir_build volumepath ListGroupSectionMappings [-h] [-to [TO ...]]
                                                 [-cc [CC ...]]
                                                 [-Block BLOCKNAME]
                                                 -StosGroup STOSGROUP
                                                 -Downsample DOWNSAMPLE
                                                 volumepath
Positional Arguments
volumepath

The path to the volume

Named Arguments
-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-Block

Block to create the StosGroup within

Default: 'TEM'

-StosGroup

Name of the StosGroup

-Downsample

Downsample level of stos files

ListMissingTilesets

Print a list of filters without tilesets

nornir_build volumepath ListMissingTilesets [-h] [-to [TO ...]] [-cc [CC ...]]
                                            [-Sections SECTIONS]
                                            [-Channels CHANNELSREGEX]
                                            [-Filters FILTERSREGEX]
                                            volumepath
Positional Arguments
volumepath

The path to the volume

Named Arguments
-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-Sections

Section numbers to process. If omitted all sections are processed. Values are separated with commas and ranges are indicated by hyphens. Ex: ‘1,3,5-7’ == [1,3,5,6,7]

-Channels

Regular expression describing channels to include, * processes all channels

Default: '*'

-Filters

Regular expression describing filters to include, * processes all filters

Default: '*'

ListPruneCutoff

List the prune thresholds set for a filter

nornir_build volumepath ListPruneCutoff [-h] [-to [TO ...]] [-cc [CC ...]]
                                        [-Sections SECTIONS]
                                        [-Channels CHANNELREGEX]
                                        [-Filters FILTERREGEX]
                                        [-header_fill HEADER_FILL]
                                        [-fill VALUE_FILL]
                                        volumepath
Positional Arguments
volumepath

The path to the volume

Named Arguments
-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-Sections

Section numbers to edit. Values are separated with commas and ranges are indicated by hyphens. Ex: ‘1,3,5-7’ == [1,3,5,6,7]. Defaults to every section

-Channels

Regular expression describing channels to be edited

Default: '*'

-Filters

Regular expression describing filters to be edited

Default: '*'

-header_fill

The amount of padding to use for names in the list

Default: 12

-fill

The amount of padding to use for prune values in the list

Default: 6

ListStosGroups

List all SliceToSlice transform groups

nornir_build volumepath ListStosGroups [-h] [-to [TO ...]] [-cc [CC ...]]
                                       [-Block BLOCKNAME]
                                       volumepath
Positional Arguments
volumepath

The path to the volume

Named Arguments
-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-Block

Block to create the StosGroup within

Default: 'TEM'

ListStosMap

List all SliceToSlice mappings within a stos map

nornir_build volumepath ListStosMap [-h] [-to [TO ...]] [-cc [CC ...]]
                                    [-Block BLOCKNAME] -Name STOSMAPNAME
                                    volumepath
Positional Arguments
volumepath

The path to the volume

Named Arguments
-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-Block

Block to create the StosGroup within

Default: 'TEM'

-Name

Name of the StosMap

MarkSectionsDamaged

Mark sections as damaged. Damaged sections are never used as control sections when chaining slice-to-slice transforms together to build slice-to-volume transforms

nornir_build volumepath MarkSectionsDamaged [-h] [-to [TO ...]] [-cc [CC ...]]
                                            [-Block BLOCKREGEX]
                                            [-Sections SECTIONS]
                                            volumepath
Positional Arguments
volumepath

The path to the volume

Named Arguments
-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-Block

Regular expression describing blocks to include, * processes all blocks

Default: '*'

-Sections

Section numbers that should not be used as control sections. Values are separated with commas and ranges are indicated by hyphens. Ex: ‘1,3,5-7’ == [1,3,5,6,7]

MarkSectionsUndamaged

Remove sections from the damaged list. Damaged sections are never used as control sections when chaining slice-to-slice transforms together to build slice-to-volume transforms

nornir_build volumepath MarkSectionsUndamaged [-h] [-to [TO ...]]
                                              [-cc [CC ...]]
                                              [-Block BLOCKREGEX]
                                              [-Sections SECTIONS]
                                              volumepath
Positional Arguments
volumepath

The path to the volume

Named Arguments
-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-Block

Regular expression describing blocks to include, * processes all blocks

Default: '*'

-Sections

Section numbers to remove from the damaged list. Values are separated with commas and ranges are indicated by hyphens. Ex: ‘1,3,5-7’ == [1,3,5,6,7]

Mosaic

Runs grid registration/refinement to produce an output transform and assembled mosaic for each selected section/channel.

nornir_build volumepath Mosaic [-h] [-to [TO ...]] [-cc [CC ...]]
                               [-Sections SECTIONS] [-Channels CHANNELSREGEX]
                               [-RegistrationDownsample DOWNSAMPLE]
                               -InputFilter INPUTFILTER
                               [-InputTransform INPUTTRANSFORMNAME]
                               [-OutputTransform OUTPUTTRANSFORMNAME]
                               [-RefineIterations REFINEITERATIONS]
                               [-Threshold DISPLACEMENTTHRESHOLD]
                               [-MinOverlap MIN_OVERLAP]
                               [-ExpandOverlapScalar EXCESS_SCALAR]
                               [-first_pass_inter_tile_distance FIRST_PASS_INTER_TILE_DISTANCE]
                               [-inter_tile_distance INTER_TILE_DISTANCE]
                               [-MinFeatureScore FEATURE_SCORE_THRESHOLD]
                               [-MinTranslateIterations MIN_TRANSLATE_ITERATIONS]
                               [-MaxTranslateIterations MAX_TRANSLATE_ITERATIONS]
                               [-RelaxIterations MAX_RELAX_ITERATIONS]
                               [-OffsetChangeTolerance OFFSET_ACCEPTANCE_THRESHOLD]
                               [-PhaseCorrelationExponent OFFSET_ACCEPTANCE_THRESHOLD]
                               [-RelaxThreshold MAX_RELAX_TENSION_CUTOFF]
                               [-CellArea CELLAREA] [-MeshSize MESHSIZE]
                               [-IncludeDiagonalOverlaps]
                               [-ScaleWeightByFeatureScore]
                               volumepath
Positional Arguments
volumepath

The path to the volume

Named Arguments
-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-Sections

Section numbers to process. If omitted all sections are processed. Values are separated with commas and ranges are indicated by hyphens. Ex: ‘1,3,5-7’ == [1,3,5,6,7]

-Channels

Regular expression describing channels to include, * processes all channels

Default: '*'

-RegistrationDownsample

Downsample level to use for ir-tools

Default: 4

-InputFilter

Filter to use for registration

Default: 'Raw8'

-InputTransform

Name of the input transform

Default: 'Prune'

-OutputTransform

Name of output transform.

Default: 'Grid'

-RefineIterations

Maximum number of refinement passes to run

Default: 10

-Threshold

Displacement threshold for control point movement (in pixels). Refinement stops below this value

Default: 0.25

-MinOverlap

Minimum amount of overlap tiles must have to contribute to the final mosaic.

Default: 0.05

-ExpandOverlapScalar

How much additional area should we pad the overlapping regions with.

Default: 1.0

-first_pass_inter_tile_distance

A value from 0 to 1 that scales the distance between the centers of the two tiles. A value of 0 considers the full images when registering. A value of 1.0 only considers the overlapping regions according to the tile transforms. Reduce this value in the first registration pass to increase the search area.

Default: 0.75

-inter_tile_distance

A value from 0 to 1 that scales the distance between the centers of the two tiles. A value of 0 considers the full images when registering. A value of 1.0 only considers the overlapping regions according to the tile transforms. Reduce this value in early registration passes to increase the search area.

Default: 1

-MinFeatureScore

Minimum average FFT power spectral density. Determines if overlapping have enough texture for registration to be accurate.

-MinTranslateIterations

Minimum number of iterations phase correlation and relaxation

Default: 1

-MaxTranslateIterations

Maximum number of iterations phase correlation and relaxation

Default: 5

-RelaxIterations

Maximum number of relaxation passes to in translation only placement phase

Default: 500

-OffsetChangeTolerance

Do not re-register (recalculate phase correlation of) a pair of overlapping tiles if the change in overlap position compared to the previous iteration is less than this distance in pixels.

Default: 1

-PhaseCorrelationExponent

Setting this value to 1 is equivalent to using phase correlation. Setting it to 0 is equivalent to using Pierson Correlation. The default is .65. If you have a difficult to register section changing this value to 1 may help.

Default: 0.65

-RelaxThreshold

Stop iteration of relaxation phase if the maximum weighted tension vector on all tiles is below this value (in pixels).

Default: 0.5

-CellArea

Size of region around each grid point to register, in pixels

Default: 128

-MeshSize

How many registration points are spaced along the images, the same value is used for X and Y. This should be a large enough number to provide 25% or ideally 50% overlap of grid cells for the expected image size.

Default: 8

-IncludeDiagonalOverlaps

Setting this flag includes tiles that only have a diagonal overlap, that is the center of the tile is outside the X/Y boundaries of the paired tile. This can introduce extra calculation time and possibly noise but be helpful if the tiles moved considerably during capture or are not laid out on a grid.

Default: True

-ScaleWeightByFeatureScore

Setting this flag multiplies the alignment weights by the feature score of the overlapping region in the translate phase. This can sometimes reduce the impact of large featureless areas but seems to introduce noise in many other cases.

Default: False

Example: nornir-build Mosaic /data/volume -InputFilter Raw8 -InputTransform Prune -OutputTransform Grid -RegistrationDownsample 4

MosaicNoTranslate

Aligns tiles of a filter into a single mosaic. Produces an assembled mosaic image. Assumes stage coordinates are correct and refines distortions only without translating tiles.

nornir_build volumepath MosaicNoTranslate [-h] [-to [TO ...]] [-cc [CC ...]]
                                          [-Sections SECTIONS]
                                          [-Channels CHANNELSREGEX]
                                          [-RegistrationDownsample DOWNSAMPLE]
                                          [-RefineIterations REFINEITERATIONS]
                                          [-CellArea CELLAREA]
                                          [-Threshold DISPLACEMENTTHRESHOLD]
                                          [-MaxOffset MAXOFFSET]
                                          -InputFilter INPUTFILTER
                                          [-InputTransform INPUTTRANSFORMNAME]
                                          [-OutputTransform OUTPUTTRANSFORMNAME]
                                          volumepath
Positional Arguments
volumepath

The path to the volume

Named Arguments
-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-Sections

Section numbers to process. If omitted all sections are processed. Values are separated with commas and ranges are indicated by hyphens. Ex: ‘1,3,5-7’ == [1,3,5,6,7]

-Channels

Regular expression describing channels to include, * processes all channels

Default: '*'

-RegistrationDownsample

Downsample level to use for ir-tools

Default: 4

-RefineIterations

Maximum number of refinement passes to run

Default: 10

-CellArea

Size of region around each grid point to register, in pixels

Default: 128

-Threshold

Displacement threshold for control point movement (in pixels). Refinement stops below this value

Default: 0.1

-MaxOffset

Comma separated list of downsample levels used for assembling output images

Default: 0.5

-InputFilter

Filter to use for registration

Default: 'Raw8'

-InputTransform

Name of the input transform

Default: 'Prune'

-OutputTransform

Name of output transform.

Default: 'Grid'

MosaicReport

Generate a web page summarizing the output of 2D section mosaics. Includes prune scores, contrast histograms, and assembled images if any.

nornir_build volumepath MosaicReport [-h] [-to [TO ...]] [-cc [CC ...]]
                                     [-PruneFilter PRUNEFILTER]
                                     [-ContrastFilter CONTRASTFILTER]
                                     [-AssembleFilter ASSEMBLEFILTER]
                                     [-AssembleDownsample ASSEMBLEDOWNSAMPLE]
                                     [-RowsPerPage ROWSPERPAGE]
                                     [-Output OUTPUTPATH]
                                     [-BuilderEndpoint BUILDERENDPOINT]
                                     volumepath
Positional Arguments
volumepath

The path to the volume

Named Arguments
-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-PruneFilter

Input filter passed to Prune pipeline

Default: 'Raw8'

-ContrastFilter

Input filter passed to Adjust Contrast pipeline

Default: 'Raw8'

-AssembleFilter

Input filter passed to Assemble or Mosaic pipeline

Default: 'Raw8'

-AssembleDownsample

Downsample level to build assembled image thumbnails from

Default: 1

-RowsPerPage

How many rows to place on a page before dividing into multiple pages

Default: 50

-Output

Name of report html file

Default: 'ImageReport.html'

-BuilderEndpoint

Endpoint for builder

MosaicToVolume

Used after slice to volume. Creates new mosaic transforms that map tiles directly into the volume space. This is done by passing the mosaic transform through a slice-to-volume transformation. Assemble can then be used to produce volume registered images.

nornir_build volumepath MosaicToVolume [-h] [-to [TO ...]] [-cc [CC ...]]
                                       [-Channels CHANNELSREGEX]
                                       [-InputDownsample STOSDOWNSAMPLE]
                                       [-InputMap INPUTMAPNAME]
                                       [-InputGroup INPUTSTOSGROUP]
                                       [-InputTransform INPUTTRANSFORMNAME]
                                       [-OutputTransform OUTPUTTRANSFORM]
                                       volumepath
Positional Arguments
volumepath

The path to the volume

Named Arguments
-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-Channels

Regular expression describing channels to be processed

Default: '*'

-InputDownsample

Downsample level of input stosgroup

Default: 1

-InputMap

Name of output group

Default: 'SliceToVolume'

-InputGroup

Name of stos group to pass mosaic transforms through

Default: 'SliceToVolume'

-InputTransform

Mosaic transform to pass through slice-to-slice transform

Default: 'Grid'

-OutputTransform

Name of output transform mapping a channel to a volume

Default: 'ChannelToVolume'

PrintContrast

Print the contrast parameters for a filter

nornir_build volumepath PrintContrast [-h] [-to [TO ...]] [-cc [CC ...]]
                                      -Sections SECTIONS
                                      [-Channels CHANNELREGEX]
                                      [-Filters FILTERREGEX]
                                      volumepath
Positional Arguments
volumepath

The path to the volume

Named Arguments
-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-Sections

Section numbers to edit. Values are separated with commas and ranges are indicated by hyphens. Ex: ‘1,3,5-7’ == [1,3,5,6,7]

-Channels

Regular expression describing channels to be edited

Default: '*'

-Filters

Regular expression describing filters to be edited

Default: '*'

Prune

Scores tiles for texture complexity and removes low-information tiles from a mosaic transform. Run before Mosaic to improve registration robustness.

nornir_build volumepath Prune [-h] [-to [TO ...]] [-cc [CC ...]]
                              [-Sections SECTIONS] [-Channels CHANNELSREGEX]
                              -DefaultThreshold DEFAULTPRUNETHRESHOLD
                              [-InputFilter INPUTFILTER]
                              [-Downsample DOWNSAMPLE]
                              [-InputTransform INPUTTRANSFORM]
                              [-OutputTransform OUTPUTTRANSFORM]
                              [-overlap OVERLAP]
                              volumepath
Positional Arguments
volumepath

The path to the volume

Named Arguments
-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-Sections

Section numbers to process. If omitted all sections are processed. Values are separated with commas and ranges are indicated by hyphens. Ex: ‘1,3,5-7’ == [1,3,5,6,7]

-Channels

Regular expression describing channels to include, * processes all channels

Default: '*'

-DefaultThreshold

Texture complexity threshold, this value is used if not user defined value is set and no previous prune operation has been run. To change this value for an already built section, use SetPruneCutoff

-InputFilter

Filter to calculate complexity upon

Default: 'Raw8'

-Downsample

Tiles are downsampled by this factor before being scored

Default: 1

-InputTransform

Mosaic transform to prune. The transform provides the list of tiles in the mosaic.

Default: 'Stage'

-OutputTransform

Name of output transform. Contains tiles from input transform minus tiles below threshold.

Default: 'Prune'

-overlap

Percentage overlap between tiles, 0.0 to 1.0

Default: 0.1

Example: nornir-build Prune /data/volume -InputFilter Raw8 -DefaultThreshold 0.2 -Sections 1-10

RefineSectionAlignment

Refines slice-to-slice alignment at the given downsample level. This pipeline is often used iteratively at higher and higher resolutions to improve registration quality.

nornir_build volumepath RefineSectionAlignment [-h] [-to [TO ...]]
                                               [-cc [CC ...]]
                                               [-SectionMap STOSMAP]
                                               [-InputGroup INPUTGROUP]
                                               -InputDownsample INPUTDOWNSAMPLE
                                               [-OutputGroup OUTPUTGROUP]
                                               -OutputDownsample OUTPUTDOWNSAMPLE
                                               [-Filters FILTERSREGEX]
                                               [-IgnoreMasks]
                                               [-Spacing GRID_SPACING]
                                               [-CellArea CELL_SIZE]
                                               [-Iterations NUM_ITERATIONS]
                                               [-AngleRange ANGLES_TO_SEARCH]
                                               [-MaxTravelForFinalization MAX_TRAVEL_FOR_FINALIZATION]
                                               [-MaxTravelForFinalizedImprovement MAX_TRAVEL_FOR_FINALIZATION_IMPROVEMENT]
                                               [-MinAlignOverlap MIN_ALIGNMENT_OVERLAP]
                                               [-MinUnmaskedCellArea MIN_UNMASKED_AREA]
                                               [-SaveImages] [-SavePlots]
                                               [-MappedSections MAPPEDSECTIONS]
                                               volumepath
Positional Arguments
volumepath

The path to the volume

Named Arguments
-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-SectionMap

Map describing which sections register to each other

Default: 'FinalStosMap'

-InputGroup

Map describing which sections register to each other

Default: 'StosBrute'

-InputDownsample

Downsample level to use for input

-OutputGroup

Name of output group

Default: 'StosGrid'

-OutputDownsample

Downsample level to use for refinement

-Filters

Regular expression describing filters to be aligned

Default: '(?![M|m]ask)'

-IgnoreMasks

Ignore masks for images if they are available. Masked areas are replaced with random noise for alignment purposes.

Default: False

-Spacing

Grid cell spacing in pixels

Default: 192

-CellArea

Area around each grid point to register, in pixels. It is suggested to have overlap between the cells. So cells of [128,128] would be spaced [64,64] apart.

Default: 256

-Iterations

Maximum number of refinement passes to run

Default: 10

-AngleRange

Range of angles to check in degrees not radians. Each cell is rotated by the angle and checked. The highest scoring registration is used.

-MaxTravelForFinalization

The maximum amount of travel a point can have from its predicted position for it is considered correctly placed.

-MaxTravelForFinalizedImprovement

When finalized points are checked to see if they need to be nudged, they must move less than this distance to be considered. If None, no limit is applied.

-MinAlignOverlap

The minimum amount of overlap a cell (point) must have with its expected position for a registration result to be considered valid.

-MinUnmaskedCellArea

Amount of cell area that must be unmasked to attempt registering a given cell

-SaveImages

Amount of cell area that must be unmasked to attempt registering a given cell

Default: False

-SavePlots

Amount of cell area that must be unmasked to attempt registering a given cell

Default: False

-MappedSections

Section numbers to map to control sections. If omitted all sections are processed. Values are separated with commas and ranges are indicated by hyphens. Ex: ‘1,3,5-7’ == [1,3,5,6,7]

RefineSectionAlignment-IrTools

Refines slice-to-slice alignment at the given downsample level. This pipeline is often used iteratively at higher and higher resolutions to improve registration quality.

nornir_build volumepath RefineSectionAlignment-IrTools [-h] [-to [TO ...]]
                                                       [-cc [CC ...]]
                                                       [-SectionMap STOSMAP]
                                                       [-InputGroup INPUTGROUP]
                                                       -InputDownsample INPUTDOWNSAMPLE
                                                       [-OutputGroup OUTPUTGROUP]
                                                       -OutputDownsample OUTPUTDOWNSAMPLE
                                                       [-Filters FILTERSREGEX]
                                                       [-UseMasks]
                                                       [-Threshold DISPLACEMENTTHRESHOLD]
                                                       [-Spacing GRIDSPACING]
                                                       [-CellArea CELLAREA]
                                                       [-Iterations ITERATIONS]
                                                       volumepath
Positional Arguments
volumepath

The path to the volume

Named Arguments
-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-SectionMap

Map describing which sections register to each other

Default: 'FinalStosMap'

-InputGroup

Map describing which sections register to each other

Default: 'StosBrute'

-InputDownsample

Downsample level to use for input

-OutputGroup

Name of output group

Default: 'StosGrid'

-OutputDownsample

Downsample level to use for refinement

-Filters

Regular expression describing filters to be aligned

Default: '(?![M|m]ask)'

-UseMasks

Use masks for images if they are available. Masked areas are replaced with random noise for alignment purposes.

Default: False

-Threshold

Displacement threshold for control point movement. Refinement stops below this value

Default: 0.1

-Spacing

Grid spacing in pixels

Default: 128

-CellArea

Size of region around each grid point to register, in pixels

Default: 256

-Iterations

Maximum number of refinement passes to run

Default: 10

RemoveFromStosMap

List all SliceToSlice mappings within a stos map

nornir_build volumepath RemoveFromStosMap [-h] [-to [TO ...]] [-cc [CC ...]]
                                          [-Block BLOCKNAME] -Name STOSMAPNAME
                                          -ControlSection CONTROLSECTION
                                          -MappedSection MAPPEDSECTION
                                          volumepath
Positional Arguments
volumepath

The path to the volume

Named Arguments
-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-Block

Block to create the StosGroup within

Default: 'TEM'

-Name

Name of the StosMap

-ControlSection

Control Section Number

-MappedSection

Mapped Section Number

RemoveStosGroup

Remove a SliceToSlice transform group

nornir_build volumepath RemoveStosGroup [-h] [-to [TO ...]] [-cc [CC ...]]
                                        -StosGroup STOSGROUP
                                        [-Block BLOCKNAME]
                                        [-Downsample DOWNSAMPLE]
                                        volumepath
Positional Arguments
volumepath

The path to the volume

Named Arguments
-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-StosGroup

Name of the StosGroup to remove

-Block

Block to create the StosGroup within

Default: 'TEM'

-Downsample

Downsample level of stos files

Default: 1

RemoveTransform

Remove a transform from the volume entirely

nornir_build volumepath RemoveTransform [-h] [-to [TO ...]] [-cc [CC ...]]
                                        -IgnoreLock -Sections SECTIONS
                                        [-Channels CHANNELREGEX]
                                        -Transform TRANSFORMREGEX
                                        volumepath
Positional Arguments
volumepath

The path to the volume

Named Arguments
-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-IgnoreLock

Ignore Filter and Transform Locks, use with care.

Default: False

-Sections

Section numbers to edit. Values are separated with commas and ranges are indicated by hyphens. Ex: ‘1,3,5-7’ == [1,3,5,6,7]

-Channels

Regular expression describing channels to be edited

Default: '*'

-Transform

Name of the transform to lock/unlock

Default: '*'

RenameFilter

Renames a filter across channels/sections and updates linked filter paths.

nornir_build volumepath RenameFilter [-h] [-to [TO ...]] [-cc [CC ...]]
                                     -InputFilter INPUTFILTER
                                     -OutputFilter NEWNAME
                                     volumepath
Positional Arguments
volumepath

The path to the volume

Named Arguments
-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-InputFilter

Existing filter name to rename (exact name match, not regex)

-OutputFilter

New filter name to assign (exact value)

RepairAnnotationOverlays

Composites TEM crop + 1-bit masks into overlays/ without restitching tiles or ingesting OData. Always rewrites overlay PNGs. Temporary helper after overlay-style changes.

nornir_build volumepath RepairAnnotationOverlays [-h] [-to [TO ...]]
                                                 [-cc [CC ...]]
                                                 -Output OUTPUTPATH
                                                 [-Sections SECTIONS]
                                                 volumepath
Positional Arguments
volumepath

The path to the volume

Named Arguments
-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-Output

Directory that already contains images/, masks/, and optional _work watermarks

-Sections

Section numbers to repair. Omitted means every Z with a watermark, else every crop image.

Example: nornir-build RepairAnnotationOverlays /data/volume -Output /data/volume/AnnotationCrops

RepairStosAngles

Negate angles for .stos files created before Dec 1st 2023

nornir_build volumepath RepairStosAngles [-h] [-to [TO ...]] [-cc [CC ...]]
                                         [-Block BLOCKREGEX]
                                         [-StosGroup STOSGROUP] [-Type TYPE]
                                         volumepath
Positional Arguments
volumepath

The path to the volume

Named Arguments
-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-Block

Block to examine the StosGroup within

Default: '*'

-StosGroup

Name of the StosGroup

Default: '*'

-Type

Type of transform

Default: 'Brute'

ReportVolumeBounds

Generate a web page summarizing the output of 2D section mosaics. Includes prune scores, contrast histograms, and assembled images if any.

nornir_build volumepath ReportVolumeBounds [-h] [-to [TO ...]] [-cc [CC ...]]
                                           -Channels CHANNELREGEX
                                           -Transforms TRANSFORMSREGEX
                                           [-StosMap STOSMAP]
                                           volumepath
Positional Arguments
volumepath

The path to the volume

Named Arguments
-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-Channels

Regular expression describing channels to be assembled

-Transforms

Transform defining images into mosaic

-StosMap

Slice-to-slice mapping of transforms. If not specified only unregistered mosaics are included.

ScaleVolumeTransforms

Scales a stos group to use a different downsample level. Useful for producing full-resolution output after generating transforms using downsampled images.

nornir_build volumepath ScaleVolumeTransforms [-h] [-to [TO ...]]
                                              [-cc [CC ...]]
                                              -InputGroup SCALEGROUPNAME
                                              -InputDownsample SCALEINPUTDOWNSAMPLE
                                              [-OutputDownsample SCALEOUTPUTDOWNSAMPLE]
                                              [-UseMasks] [-workers WORKERS]
                                              volumepath
Positional Arguments
volumepath

The path to the volume

Named Arguments
-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-InputGroup

Name of stos group to scale

-InputDownsample

Downsample level of input stosgroup

-OutputDownsample

Downsample level of output. Defaults to 1.

Default: 1

-UseMasks

Use masks for images if they are available. Masked areas are replaced with random noise for alignment purposes.

Default: False

-workers

Parallel worker count for per-transform scaling. Defaults to CPU count; use 1 for serial.

ScoreAnnotationCrops

Writes sam2* columns on annotation_crops.sqlite using a ground-truth bbox prompt. Requires the optional SAM2 stack (not the gallery image, not the default headless install). No-op with a log line when SAM2 is not installed. Does not spawn from the gallery HTTP process.

nornir_build volumepath ScoreAnnotationCrops [-h] [-to [TO ...]]
                                             [-cc [CC ...]] -Output OUTPUTPATH
                                             [-Checkpoint CHECKPOINT]
                                             volumepath
Positional Arguments
volumepath

The path to the volume

Named Arguments
-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-Output

AnnotationCrops directory that already has annotation_crops.sqlite

-Checkpoint

SAM2 checkpoint path on the build machine

Example: nornir-build ScoreAnnotationCrops /data/volume -Output /data/volume/AnnotationCrops -Checkpoint /models/sam2.pt

ScoreStosGroupQuality

Compute full-pair ZNCC for each .stos in a group, write stos_quality.json, and set Transform PairZNCC attributes.

nornir_build volumepath ScoreStosGroupQuality [-h] [-to [TO ...]]
                                              [-cc [CC ...]]
                                              -StosGroup STOSGROUP
                                              -Downsample INPUTDOWNSAMPLE
                                              -StosMap STOSMAP
                                              [-MaxSide MAXSIDE] [-Force]
                                              volumepath
Positional Arguments
volumepath

The path to the volume

Named Arguments
-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-StosGroup

Stos group to score

Default: 'StosBrute'

-Downsample

Downsample level of the stos group

-StosMap

Stos map describing which pairs to score

Default: 'FinalStosMap'

-MaxSide

Clamp longest image side (pixels) before scoring

Default: 2048

-Force

Recompute pair ZNCC even when the cache entry is fresh

Default: False

SelectBestRegistrationChain

Create a new registration chain by examining the stos overlays produced by AssembleStosOverlays. If two registrations are possible for a section the overlay with the most overlap is chosen.

nornir_build volumepath SelectBestRegistrationChain [-h] [-to [TO ...]]
                                                    [-cc [CC ...]]
                                                    -StosGroup STOSGROUP
                                                    -Downsample INPUTDOWNSAMPLE
                                                    -InputStosMap INPUTSTOSMAP
                                                    [-OutputStosMap OUTPUTSTOSMAP]
                                                    volumepath
Positional Arguments
volumepath

The path to the volume

Named Arguments
-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-StosGroup

Stos group to assemble

Default: 'StosBrute'

-Downsample

Downsample level to assemble

-InputStosMap

Name assigned to generated stos map.

Default: 'PotentialRegistrationChain'

-OutputStosMap

Name assigned to generated stos map.

Default: 'FinalStosMap'

SetContrast

Set the contrast parameters for a filter

nornir_build volumepath SetContrast [-h] [-to [TO ...]] [-cc [CC ...]]
                                    [-Min MINVALUE] [-Max MAXVALUE]
                                    [-Gamma GAMMAVALUE] -Sections SECTIONS
                                    [-Channels CHANNELREGEX]
                                    [-Filters FILTERREGEX]
                                    volumepath
Positional Arguments
volumepath

The path to the volume

Named Arguments
-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-Min

Min intensity value, set to 0 in output

Default: NaN

-Max

Max intensity value, set to 1 in output

Default: NaN

-Gamma

Gamma adjustment

Default: NaN

-Sections

Section numbers to edit. Values are separated with commas and ranges are indicated by hyphens. Ex: ‘1,3,5-7’ == [1,3,5,6,7]

-Channels

Regular expression describing channels to be edited

Default: '*'

-Filters

Regular expression describing filters to be edited

Default: '*'

SetFilterLock

Toggle the locked flag for a filter. Locked filters will not have images recalculated.

nornir_build volumepath SetFilterLock [-h] [-to [TO ...]] [-cc [CC ...]]
                                      -Locked LOCKED -Sections SECTIONS
                                      [-Channels CHANNELREGEX]
                                      [-Filters FILTERREGEX]
                                      volumepath
Positional Arguments
volumepath

The path to the volume

Named Arguments
-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-Locked

Lock value, 0 = unlocked, 1 = locked

-Sections

Section numbers to edit. Values are separated with commas and ranges are indicated by hyphens. Ex: ‘1,3,5-7’ == [1,3,5,6,7]

-Channels

Regular expression describing channels to be edited

Default: '*'

-Filters

Regular expression describing filters to be edited

Default: '*'

SetFilterMaskName

Specify another filter in the same channel to use as a mask when using this filter.

nornir_build volumepath SetFilterMaskName [-h] [-to [TO ...]] [-cc [CC ...]]
                                          -InputFilter INPUTFILTER
                                          -MaskName NEWNAME
                                          volumepath
Positional Arguments
volumepath

The path to the volume

Named Arguments
-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-InputFilter

Existing filter name to rename (exact name match, not regex)

-MaskName

New Mask Name for filter name

SetMosaicLock

Toggle the locked flag for a .mosaic transform to prevent or enable regeneration.

nornir_build volumepath SetMosaicLock [-h] [-to [TO ...]] [-cc [CC ...]]
                                      -Locked LOCKED -Sections SECTIONS
                                      [-Channels CHANNELREGEX]
                                      -Transforms TRANSFORMREGEX
                                      volumepath
Positional Arguments
volumepath

The path to the volume

Named Arguments
-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-Locked

Lock value, 0 = unlocked, 1 = locked

-Sections

Section numbers to edit. Values are separated with commas and ranges are indicated by hyphens. Ex: ‘1,3,5-7’ == [1,3,5,6,7]

-Channels

Regular expression describing channels to be edited

Default: '*'

-Transforms

Regular expression describing transform names to be edited

SetPruneCutoff

Set the prune threshold for a filter. The new value will not update the volume until the Prune operation is run.

nornir_build volumepath SetPruneCutoff [-h] [-to [TO ...]] [-cc [CC ...]]
                                       -Value PRUNEVAL -Sections SECTIONS
                                       [-Channels CHANNELREGEX]
                                       [-Filters FILTERREGEX]
                                       volumepath
Positional Arguments
volumepath

The path to the volume

Named Arguments
-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-Value

Prune threshold to set

Default: 0

-Sections

Section numbers to edit. Values are separated with commas and ranges are indicated by hyphens. Ex: ‘1,3,5-7’ == [1,3,5,6,7]

-Channels

Regular expression describing channels to be edited

Default: '*'

-Filters

Regular expression describing filters to be edited

Default: '*'

SetTransformLock

Toggle the locked flag for a filter. Locked filters will not have images recalculated.

nornir_build volumepath SetTransformLock [-h] [-to [TO ...]] [-cc [CC ...]]
                                         -Locked LOCKED -Sections SECTIONS
                                         [-Channels CHANNELREGEX]
                                         [-Transform TRANSFORMREGEX]
                                         volumepath
Positional Arguments
volumepath

The path to the volume

Named Arguments
-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-Locked

Lock value, 0 = unlocked, 1 = locked

-Sections

Section numbers to edit. Values are separated with commas and ranges are indicated by hyphens. Ex: ‘1,3,5-7’ == [1,3,5,6,7]

-Channels

Regular expression describing channels to be edited

Default: '*'

-Transform

Name of the transform to lock/unlock

Default: '*'

ShadeCorrect

Brightfield microscopy shading correction. Uses the max tile intensity across all tiles to determine the shading gradient. Produces an inverted output filter with the shading subtracted.

nornir_build volumepath ShadeCorrect [-h] [-to [TO ...]] [-cc [CC ...]]
                                     [-Sections SECTIONS]
                                     [-Channels CHANNELSREGEX]
                                     [-Filters FILTERSREGEX]
                                     [-OutputFilter OUTPUTFILTER]
                                     -Correction {brightfield,darkfield}
                                     volumepath
Positional Arguments
volumepath

The path to the volume

Named Arguments
-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-Sections

Section numbers to process. If omitted all sections are processed. Values are separated with commas and ranges are indicated by hyphens. Ex: ‘1,3,5-7’ == [1,3,5,6,7]

-Channels

Regular expression describing channels to include, * processes all channels

Default: '*'

-Filters

Regular expression describing filters to include, * processes all filters

Default: '(?![M|m]ask)'

-OutputFilter

Prefix added to output filters

Default: 'ShadingCorrected'

-Correction

Possible choices: brightfield, darkfield

Brightfield images have a light background with darker features. Darkfield images have a dark background with light features.

Default: 'brightfield'

SliceToVolume

Created a group of slice-to-volume transforms from a group of slice-to-slice transforms

nornir_build volumepath SliceToVolume [-h] [-to [TO ...]] [-cc [CC ...]]
                                      [-Downsample STOVDOWNSAMPLE]
                                      -InputGroup STOVINPUTGROUP
                                      [-OutputGroup STOVOUTPUTGROUPNAME]
                                      [-InputMap INPUTMAP]
                                      [-OutputMap OUTPUTMAP] [-NoEnrichment]
                                      [-Tolerance TOLERANCE] [-NoLinearBlend]
                                      [-min_blend MIN_BLEND]
                                      [-linear_factor LINEAR_BLEND_FACTOR]
                                      [-max_blend MAX_BLEND]
                                      [-travel_limit TRAVEL_LIMIT]
                                      [-reblend_iterations REBLEND_ITERATIONS]
                                      [-reblend_tolerance REBLEND_TOLERANCE]
                                      [-no_rotation] [-mesh_rigid_linear]
                                      volumepath
Positional Arguments
volumepath

The path to the volume

Named Arguments
-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-Downsample

Downsample level to use for SliceToVolume

Default: 16

-InputGroup

Map describing which sections register to each other

Default: 'StosGrid'

-OutputGroup

Name of output group

Default: 'SliceToVolume'

-InputMap

Name of output group

Default: 'FinalStosMap'

-OutputMap

Name of output registration map. Defaults to -OutputGroup name if omitted.

-NoEnrichment

Do not add extra control points to slice-to-volume transforms to increase accuracy.

Default: True

-Tolerance

Maximum distance, at full resolution, between the expected and actual position of transformed triangle centroids. Above this value a control point is added at the centroid to increase transform accuracy.

Default: 64

-NoLinearBlend

Compose slice-to-volume transforms without per-section linear blend. Overrides -min_blend and -travel_limit pipeline defaults.

Default: False

-min_blend

Floor weight toward rigid linear blend during composition (0–1).

Default: 0.05

-linear_factor

Deprecated alias for -min_blend.

-max_blend

Cap per-point rigid blend weight during composition.

-travel_limit

Full-resolution distance scale for smooth per-point blend toward the rigid transform prediction during chain composition.

Default: 512

-reblend_iterations

Iterative linear-blend passes per transform composition. Use 1 for a single pass.

Default: 8

-reblend_tolerance

Stop re-blending when the maximum control-point movement falls below this distance (pixels at working resolution).

Default: 0.5

-no_rotation

Added for SEM volumes where it is certain there is no rotation from section to section, defaults to False

Default: False

-mesh_rigid_linear

Use rigid fit of accumulated B→C mesh for linear blend instead of composed rigid slice-to-slice chain.

Default: True

StosReport

Generate a web page containing a summary of the alignments between sections in a 3D volume

nornir_build volumepath StosReport [-h] [-to [TO ...]] [-cc [CC ...]]
                                   -StosGroup STOSGROUP [-Output OUTPUTPATH]
                                   volumepath
Positional Arguments
volumepath

The path to the volume

Named Arguments
-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-StosGroup

Stos group to pull images from

-Output

Name of report html file

Default: 'StosReport.html'

SyncValidationTimes

Walks filesystem-backed volume nodes and realigns ValidationTime to current mtimes so copied volumes do not look modified and trigger unnecessary pyramid rebuilds.

nornir_build volumepath SyncValidationTimes [-h] [-to [TO ...]] [-cc [CC ...]]
                                            [-dryrun]
                                            volumepath
Positional Arguments
volumepath

The path to the volume

Named Arguments
-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-dryrun

Report nodes that would change without updating ValidationTime

Default: False

Example: nornir-build SyncValidationTimes /data/volume

VolumeImage

Produces an assembled image for transforms in a stos group. If the transforms are slice-to-volume transforms the output should be registered into a volume. Note that using this function requires assembled images to exist at full resolution. If these do not exist see the MosaicToVolume pipeline.

nornir_build volumepath VolumeImage [-h] [-to [TO ...]] [-cc [CC ...]]
                                    [-InputGroup VOLUMEIMAGEGROUPNAME]
                                    [-InputDownsample VOLUMEIMAGEDOWNSAMPLE]
                                    volumepath
Positional Arguments
volumepath

The path to the volume

Named Arguments
-to

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-cc

E-Mail addresses for reports. Use with pipelines that emit notifications.

Default: ''

-InputGroup

Name of stos group to create scaled version of, default = SliceToVolume

Default: 'SliceToVolume'

-InputDownsample

Downsample level of input stosgroup, default = 1

Default: 1

Examples:

nornir-build ImportIDoc /data/volume /data/idoc nornir-build -debug -computational_library cupy Mosaic /data/volume -Sections 1-10 nornir-build help Mosaic

nornir_buildmanager.build.BuildParserRoot() → ArgumentParser[source]
nornir_buildmanager.build.Execute(buildArgs=None)[source]

Run the nornir-build command line entrypoint.

The argv parser accepts canonical subcommand ordering and legacy test ordering that starts with volumepath.

nornir_buildmanager.build.ExecuteChain(buildArgs: list[str]) → None[source]

Run multiple pipelines sequentially in one process, separated by --then.

nornir_buildmanager.build.InitLogging(buildArgs)[source]

Initialize persistent logging for the current command invocation.

Logging writes through nornir_shared.misc.SetupLogging. When a volumepath is present, file logs go under <volumepath>/logs. -debug sets the level to DEBUG; otherwise WARN is used.

nornir_buildmanager.build.SetupLogging(LogToFile: bool = False, OutputPath: str | None = None, Level=None)[source]
Parameters:
  • LogToFile (bool) – True if logs should be saved to a file. Automatically set to true if OutputPath is not None

  • OutputPath (str) – Path to directory to use to save log files.

  • Level – Level of messages to write to log

class nornir_buildmanager.build.TaskTimer[source]

Bases: object

Helper class that allows us to manually record how long a given section of code took to execute

ElapsedString(task)[source]
property ElapsedTimes: dict[str, float]

Return a copy of recorded task wall times in seconds.

End(task, print_elapsed=True)[source]

Stop a timer for a task, print output if PrintElapsed is not explicitely set to False

Start(task)[source]
nornir_buildmanager.build.call_pipeline(args)[source]
nornir_buildmanager.build.call_recover_import_meta_data(args)[source]

Recover notes metadata from text files under the volume or an import directory.

nornir_buildmanager.build.call_recover_links(args)[source]

This function checks for missing link elements in a volume and adds them back to the volume

nornir_buildmanager.build.call_repair_xml(args)[source]

Repair malformed VolumeData XML files with trailing content.

This migration-style repair targets older metadata where characters were written after the closing XML tag (primarily pre-Dec 2023 data sets).

nornir_buildmanager.build.init_computational_library(args: Namespace)[source]

Select CPU/GPU computation backend and export process environment.

Records the backend the build asked for in NORNIR_COMPUTATIONAL_LIBRARY_REQUESTED and updates nornir_imageregistration’s active backend, which sets NORNIR_COMPUTATIONAL_LIBRARY to the backend actually in effect.

The two can diverge: requesting cupy on a host whose CuPy runtime probe fails leaves requested=cupy / effective=numpy. Keeping both lets a build log show that a GPU run silently fell back to the CPU.

nornir_buildmanager.build.is_headless() → bool[source]
nornir_buildmanager.build.lowpriority()[source]

Set the priority of the process to below-normal. Copied from: http://stackoverflow.com/questions/1023038/change-process-priority-in-python-cross-platform

nornir_buildmanager.build.print_help(args)[source]

Created on Apr 2, 2012

class nornir_buildmanager.pipelinemanager.Any(*args, **kwargs)[source]

Bases: object

Special type indicating an unconstrained type.

  • Any is compatible with every type.

  • Any assumed to have all methods.

  • All values assumed to be instances of Any.

Note that all the above statements are true from the point of view of static type checkers. At runtime, Any should not be used with instance checks.

class nornir_buildmanager.pipelinemanager.ArgumentSet(PipelineName: str | None = None)[source]

Bases: object

Collection of arguments from each source

AddArguments(args)[source]

Add arguments from the command line

AddAttributes(Node: Element)[source]

Add attributes from an element node to the dargs dictionary. Parameter values preceeded by a ‘#’ are keys to existing entries in the dictionary whose values are copied to the entry for the attribute

AddParameters(Node: Element, dargsKeyname=None)[source]

Add entries from a dictionary node to the dargs dictionary. Parameter values preceeded by a ‘#’ are keys to existing entries in the dictionary whose values are copied to the entry for the attribute. If dargsKeyname is none all parameters are added directly to dargs dictionary. Otherwise they are added as a dictionary under a key=dargsKeyname

AddVariable(key, value)[source]
property Arguments
property Attribs
ClearAttributes()[source]
ClearParameters()[source]
KeyWordArgs()[source]
property Parameters
RemoveAttributes(Node: Element)[source]

Remove attributes present in the node from the attrib dictionary

RemoveParameters(Node: Element)[source]
Parameters:

Node

Returns:

Remove entries from a dargs dictionary.

RemoveVariable(key)[source]
ReplaceVariable(xpath: str, iStart: int)[source]

Replace # variable names in an xpath with variable string values

SubstituteStringVariables(xpath: str) → str[source]

Replace all instances of # in a string with the variable names

TryGetSubstituteObject(val: str)[source]

Place an object directly into a dictionary. :param str val: The key to lookup :return: Tuple (bool, value) Returns true on success with the value or None for failure. Not if the value is found and the value is None then (true, None) is returned.

TryGetValueForKey(key)[source]
property Variables
exception nornir_buildmanager.pipelinemanager.NornirMissingDependencyException(message, **kwargs)[source]

Bases: Exception

A dependency required for the pipeline is missing. This halts execution and displays the message the user

exception nornir_buildmanager.pipelinemanager.NornirRethrownException(**kwargs)[source]

Bases: Exception

An exception for rethrowing an exception where output for the original exception already been provided and we do not want it rehandled by a recursive try/except block. Ensure context is preserved by using this syntax: raise NornirRethrownException from e

class nornir_buildmanager.pipelinemanager.PathLike[source]

Bases: ABC

Abstract base class for implementing the file system path protocol.

exception nornir_buildmanager.pipelinemanager.PipelineArgumentNotFound(argname, **kwargs)[source]

Bases: PipelineError

A select statement could not find the requested node

argname: str
exception nornir_buildmanager.pipelinemanager.PipelineError(VolumeElem=None, PipelineNode=None, message=None, *args)[source]

Bases: Exception

An expected node did not exist

ErrorList()[source]
exception nornir_buildmanager.pipelinemanager.PipelineListIntersectionFailed(listOfValid, attribValue, **kwargs)[source]

Bases: PipelineError

A regular expression search could not match any nodes

classmethod GenErrorMessage(list_of_valid, value)[source]
class nornir_buildmanager.pipelinemanager.PipelineManager(pipelinesRoot: ElementTree, pipelineData)[source]

Bases: object

Responsible for the execution of a pipeline specified in an XML file following the buildscript.xsd specification

static AddPipelineNodeVariable(PipelineNode, VolumeElem: XElementWrapper, ArgSet)[source]

Adds a variable to our dictionary passed to functions

property Description: str | None
property Epilog: str | None
Execute(args, volume_tree=None)[source]

This executes the loaded pipeline on the specified volume of data. parser is an instance of the argparser class which should be extended with any pipeline specific arguments args are the parameters from the command line

ExecuteChildPipelines(ArgSet, VolumeElem: XElementWrapper, PipelineNode)[source]

Run all of the child pipeline elements on the volume element

GetArgParser(parser=None, IncludeGlobals: bool = True)[source]

Create the complete argument parser for the pipeline :param parser: :param bool IncludeGlobals: Arguments common to all pipelines are included if this flag is set to True. True by default. False is used to create documentation

classmethod GetSearchRoot(VolumeElem: XElementWrapper, PipelineNode, ArgSet)[source]
property Help: str | None
IndentLevel = 0
classmethod ListPipelines(pipeline_tree: ElementTree | Element) → list[str][source]
classmethod Load(PipelineXml: str | ElementTree, PipelineName: str | None = None)[source]
classmethod LoadPipelineXML(PipelineXML: str | ElementTree | bytes | PathLike[str] | PathLike[bytes] | SupportsRead[bytes] | SupportsRead[str]) → ElementTree[source]
classmethod PrintPipelineEnumeration(PipelineXML: str | ElementTree)[source]
ProcessIterateNode(ArgSet, VolumeElem: XElementWrapper, PipelineNode)[source]
ProcessPythonCall(ArgSet, VolumeElem: XElementWrapper, PipelineNode)[source]
static ProcessRequireMatchNode(ArgSet, VolumeElem: XElementWrapper, PipelineNode)[source]

If the regular expression does not match the attribute an exception is raised. This skips the current iteration of an enclosing <iterate> element

ProcessSelectNode(ArgSet, VolumeElem: XElementWrapper, PipelineNode)[source]
ProcessStageElement(VolumeElem: XElementWrapper, PipelineNode, ArgSet=None)[source]
static RemovePipelineNodeVariable(ArgSet, PipelineNode)[source]

Adds a variable to our dictionary passed to functions

static RequireSetMembership(ArgSet, VolumeElem: XElementWrapper, PipelineNode)[source]

If the attribute value is not present in the provided list the element is skipped. If the provided list is none we do not skip.

classmethod RunPipeline(PipelineXmlFile: str | ElementTree, PipelineName: str, args, volume_tree=None)[source]
classmethod ToElementString(element: Element) → str[source]
logger = <Logger PipelineManager (WARNING)>
exception nornir_buildmanager.pipelinemanager.PipelineRegExSearchFailed(regex: str, attribValue: Any, **kwargs)[source]

Bases: PipelineError

A regular expression search could not match any nodes

attribValue: Any
regex: str
exception nornir_buildmanager.pipelinemanager.PipelineSearchFailed(xpath: str, **kwargs)[source]

Bases: PipelineError

A find statement could not match any nodes

xpath: str
exception nornir_buildmanager.pipelinemanager.PipelineSearchRootNotFound(argname: str, **kwargs)[source]

Bases: PipelineArgumentNotFound

A select statement could not find the requested node

exception nornir_buildmanager.pipelinemanager.PipelineSelectFailed(xpath: str, **kwargs)[source]

Bases: PipelineError

A select statement could not find the requested node. This means a variable was not populated and the remaining statements in an iteration should not execute or they may use stale data

xpath: str
class nornir_buildmanager.pipelinemanager.Protocol[source]

Bases: Generic

Base class for protocol classes.

Protocol classes are defined as:

class Proto(Protocol):
    def meth(self) -> int:
        ...

Such classes are primarily used with static type checkers that recognize structural subtyping (static duck-typing).

For example:

class C:
    def meth(self) -> int:
        return 0

def func(x: Proto) -> int:
    return x.meth()

func(C())  # Passes static type check

See PEP 544 for details. Protocol classes decorated with @typing.runtime_checkable act as simple-minded runtime protocols that check only the presence of given attributes, ignoring their type signatures. Protocol classes can be generic, they are defined as:

class GenProto[T](Protocol):
    def meth(self) -> T:
        ...
class nornir_buildmanager.pipelinemanager.SupportsRead(*args, **kwargs)[source]

Bases: Protocol[T]

read(size: int = -1) → bytes[source]
class nornir_buildmanager.pipelinemanager.TaskTimer[source]

Bases: object

Helper class that allows us to manually record how long a given section of code took to execute

ElapsedString(task)[source]
property ElapsedTimes: dict[str, float]

Return a copy of recorded task wall times in seconds.

End(task, print_elapsed=True)[source]

Stop a timer for a task, print output if PrintElapsed is not explicitely set to False

Start(task)[source]
class nornir_buildmanager.pipelinemanager.TypeVar

Bases: object

Type variable.

The preferred way to construct a type variable is via the dedicated syntax for generic functions, classes, and type aliases:

class Sequence[T]:  # T is a TypeVar
    ...

This syntax can also be used to create bound and constrained type variables:

# S is a TypeVar bound to str
class StrSequence[S: str]:
    ...

# A is a TypeVar constrained to str or bytes
class StrOrBytesSequence[A: (str, bytes)]:
    ...

Type variables can also have defaults:

class IntDefault[T = int]:

…

However, if desired, reusable type variables can also be constructed manually, like so:

T = TypeVar('T')  # Can be anything
S = TypeVar('S', bound=str)  # Can be any subtype of str
A = TypeVar('A', str, bytes)  # Must be exactly str or bytes
D = TypeVar('D', default=int)  # Defaults to int

Type variables exist primarily for the benefit of static type checkers. They serve as the parameters for generic types as well as for generic function and type alias definitions.

The variance of type variables is inferred by type checkers when they are created through the type parameter syntax and when infer_variance=True is passed. Manually created type variables may be explicitly marked covariant or contravariant by passing covariant=True or contravariant=True. By default, manually created type variables are invariant. See PEP 484 and PEP 695 for more details.

evaluate_bound
evaluate_constraints
evaluate_default
has_default()
class nornir_buildmanager.pipelinemanager.VolumeManager(volumeData, filename)[source]

Bases: object

classmethod CalcVolumeChecksum(VolumeObj)[source]
classmethod Create(VolumePath: str)[source]
classmethod Load(VolumePath: str, Create: bool = False, UseCache: bool = True)[source]

Load the volume information for the specified directory or create one if it doesn’t exist

classmethod Save(VolumeObj)[source]

Save the volume to an XML file, putting sub-elements in seperate folders

classmethod SaveSingleFile(VolumeObj, xmlfile_fullpath)[source]

Save the volume to a single XML file

class nornir_buildmanager.pipelinemanager.XContainerElementWrapper(tag, attrib=None, **extra)[source]

Bases: XResourceElementWrapper

XML meta-data for a container whose sub-elements are contained within a directory on the file system. The directories container will always be the same, such as TilePyramid

IsValid() → tuple[bool, str][source]

This function should be overridden by derived classes. It returns true if the file system or other external resources match the state recorded within the element.

IsValid should always do the full work of validation and then update any meta-data, such as ValidationTime, to indicate the validation was done. NeedsValidation should be used to determine if an element needs an IsValid call or if a check of the XElement state was sufficient to believe it is in a valid state. IsValidLazy will only call IsValid on elements whose NeedsValidation call is True.

Returns Tuple of state and a string with a reason

property Path: str
RepairMissingLinkElements(recurse: bool = True)[source]

Searches all subdirectories under the element. Any VolumeData.xml files found are loaded and a link is created for the top level element. Written to repair the case where a VolumeData.xml is deleted and we want to recover at least some of the data.

Save(tabLevel: int | None = None, recurse: bool = True)[source]

Public version of Save, if this element is not flagged SaveAsLinkedElement then we need to save the parent to ensure our data is retained

property SaveAsLinkedElement: bool

True when this container owns its own VolumeData.xml under FullPath.

Linked containers (default True) are referenced from the parent as a *_Link stub and persist independently: each owns its dirty flags (AttributesChanged / ChildrenChanged). Nested linked dirtiness does not bubble to the parent. When False, meta-data remains embedded in the parent’s XML so parent save consults nested non-linked dirty flags.

property SortKey: str

The default key used for sorting elements

class nornir_buildmanager.pipelinemanager.XElementWrapper(tag: str, attrib=None, **extra)[source]

Bases: Element

AddChild(new_child_element)[source]
property AttributesChanged: bool

True if this element’s XML attributes need to be written to disk.

Set at mutation time by attribute assignment paths (__setattr__ / property setters that update attrib), not by Save. Cleared only by ResetElementChangeFlags() after a successful save of the XML that owns this element. Prefer letting mutation APIs set this; assign True manually only for rare explicit dirties when attrib was changed outside those paths.

property Checksum: str
property ChildrenChanged: bool

True if this element’s direct child list needs to be written to disk.

Set at mutation time by append, remove, and UpdateOrAddChild* on this element (not by nested linked containers mutating themselves). Cleared only by ResetElementChangeFlags() after a successful save. Linked children own their own VolumeData.xml and flags; their dirtiness does not set this parent flag.

Clean(reason: str | None = None)[source]

Remove node from element tree and remove any external resources such as files.

Under no-delete mode, logs the intent and returns without removing anything from the tree or the filesystem.

CleanIfInvalid() → tuple[bool, str][source]

Remove the contents of this node if it is out of date.

Under no-delete mode the node is never actually removed; returns (False, reason) so callers treat the element as still present.

Returns:

(cleaned, reason) where cleaned is True when the node was (or would have been) removed.

CompareAttributes(dictAttrib: dict)[source]

Compare the passed dictionary with the attributes on the node, return entries which do not match

Contains(Element: XElementWrapper) → bool[source]

True if a direct child matches Element on tag and attributes.

CreationDate is ignored so a freshly built probe can match a child that already carries an auto-stamped date. Compares Element’s attributes to each child (not the parent’s), which is what duplicate detection needs.

Copy() → XElementWrapper[source]

Deep-copy this element and its descendant wrappers.

Children are copied recursively so the result is not attached to the source tree and does not share child identity with it.

property CreationTime: datetime
property ElementHasChangesToSave: bool

Whether this element’s XML file needs a rewrite, based on dirty flags.

Reads flags already set at mutation time. Does not invent dirtiness or walk linked containers (SaveAsLinkedElement) that save themselves. May consult non-linked nested children only, because those nodes are serialized into this element’s XML (no separate VolumeData.xml).

FindAllFromParent(xpath: str) → Generator[XElementWrapper, None, None] | None[source]

Run findall on xpath on each parent, return results only first nearest parent with resuls

FindFromParent(xpath: str) → XElementWrapper | None[source]

Run find on xpath on each parent, return first hit

FindParent(ParentTag: str) → XElementWrapper | None[source]

Find parent with specified tag

GetChildByAttrib(ElementName: str, AttribName: str, AttribValue: float | str) → XElementWrapper | None[source]
GetChildrenByAttrib(ElementName: str, AttribName: str, AttribValue: float | str) → Generator[XElementWrapper, None, None][source]
IsParent(node) → bool[source]

Returns true if the node is a parent

IsValid() → tuple[bool, str][source]

This function should be overridden by derived classes. It returns true if the file system or other external resources match the state recorded within the element.

IsValid should always do the full work of validation and then update any meta-data, such as ValidationTime, to indicate the validation was done. NeedsValidation should be used to determine if an element needs an IsValid call or if a check of the XElement state was sufficient to believe it is in a valid state. IsValidLazy will only call IsValid on elements whose NeedsValidation call is True.

Returns Tuple of state and a string with a reason

IsValidLazy() → tuple[bool, str][source]

First checks if the XElement requires validation before invoking IsValid

LoadAllLinkedNodes()[source]

Recursively load all the linked nodes on this element

property NeedsValidation: bool
OnParentChanged()[source]

Actions that should occur when our parent changes

property Parent: XElementWrapper | None
classmethod RemoveDuplicateElements(tagName: str)[source]

For nodes that should not be duplicated this function removes all but the last created element

RemoveOldChildrenByAttrib(ElementName: str, AttribName: str, AttribValue)[source]

If multiple children match the criteria, we remove all but the child with the latest creation date

Substitute a link stub for a container child, marking this element dirty.

Unlike the resolution path this really does restructure the parent: the container’s content stops being part of this element’s XML, so the change has to be persisted.

ResetElementChangeFlags()[source]

Clear dirty flags after this element’s XML was successfully written.

Clears this element and non-linked nested children that share the same file. Does not clear linked containers (they reset when they save). Call only after a successful write—not to mean “I decided nothing changed.”

property Root: XElementWrapper

The root of the element tree

SetParentNoChangeFlag(value)[source]

This is not a setter to avoid triggering the Attribute Changed flag with the __setattr__ override for this class

property SortKey

The default key used for sorting elements

ToElementString() → str[source]
UpdateOrAddChild(element: XElementWrapper, XPath: str | None = None) → tuple[bool, XElementWrapper][source]

Adds an element using the specified XPath. If the XPath is unspecified the element name is used Returns a tuple with (True/False, Element). True indicates the element did not exist and was added. False indicates the element existed and the existing value is returned.

UpdateOrAddChildByAttrib(element: _XT, AttribNames=None) → tuple[bool, _XT][source]
property Version: float
append(Child)[source]
find(path: str, namespaces=None) → XElementWrapper | None[source]
findall(path: str, namespaces=None) → Generator[XElementWrapper, None, None][source]
indexofchild(obj) → int[source]

Return the index of a child element

logger = <Logger XElementWrapper (WARNING)>
remove(Child)[source]
sort(recurse: bool = True)[source]

Order child elements

classmethod wrap(dictElement: XElementWrapper | Element) → XElementWrapper[source]

Change the class of an ElementTree.Element(PropertyElementName) to add our wrapper functions

class nornir_buildmanager.pipelinemanager.XResourceElementWrapper(tag: str, attrib=None, **extra)[source]

Bases: Lockable, XElementWrapper

Wrapper for an XML element that refers to a file or directory

property ChangesSinceLastValidation: bool | None

True if the modification time on the directory is later than our last validation time, or None if the path doesn’t exist

Type:

return

Clean(reason: str | None = None)[source]

Remove the file or directory referred to by this node, then remove the node.

Under no-delete mode, logs what would have been deleted and returns without touching the filesystem or the XML tree.

property FileSystemModifiedSinceLastValidation: bool
property FullPath: str
property LastFileSystemModificationTime: datetime | None

The most recent time the resource’s file or directory was modified. Used to indicate that a verification needs to be repeated. None is returned if the file or directory does not exist :rtype: datetime.datetime

Type:

return

property NeedsValidation: bool
property Path: str
ToElementString() → str[source]
UpdateValidationTime()[source]

Sets ValidationTime to the LastModified time on the file or directory

property ValidationTime: datetime

An optional attribute to record the last time we validated the state of the file or directory this element represents. :return: Returns datetime.min if the attribute has not been set

class nornir_buildmanager.pipelinemanager.datetime(year, month, day[, hour[, minute[, second[, microsecond[, tzinfo]]]]])

Bases: date

The year, month and day arguments are required. tzinfo may be None, or an instance of a tzinfo subclass. The remaining arguments may be ints.

astimezone()

tz -> convert to local time in new timezone tz

classmethod combine()

date, time -> datetime with same date and time fields

ctime()

Return ctime() style string.

date()

Return date object with same year, month and day.

dst()

Return self.tzinfo.dst(self).

fold
classmethod fromisoformat(object, /)

string -> datetime from a string in most ISO 8601 formats

classmethod fromtimestamp()

timestamp[, tz] -> tz’s local time from POSIX timestamp.

hour
isoformat()

[sep] -> string in ISO 8601 format, YYYY-MM-DDT[HH[:MM[:SS[.mmm[uuu]]]]][+HH:MM]. sep is used to separate the year from the time, and defaults to ‘T’. The optional argument timespec specifies the number of additional terms of the time to include. Valid options are ‘auto’, ‘hours’, ‘minutes’, ‘seconds’, ‘milliseconds’ and ‘microseconds’.

max = datetime.datetime(9999, 12, 31, 23, 59, 59, 999999)
microsecond
min = datetime.datetime(1, 1, 1, 0, 0)
minute
classmethod now(tz=None)

Returns new datetime object representing current time local to tz.

tz

Timezone object.

If no tz is specified, uses local timezone.

replace()

Return datetime with new specified fields.

resolution = datetime.timedelta(microseconds=1)
second
classmethod strptime()

string, format -> new datetime parsed from a string (like time.strptime()).

time()

Return time object with same time but with tzinfo=None.

timestamp()

Return POSIX timestamp as float.

timetuple()

Return time tuple, compatible with time.localtime().

timetz()

Return time object with same time and tzinfo.

tzinfo
tzname()

Return self.tzinfo.tzname(self).

classmethod utcfromtimestamp()

Construct a naive UTC datetime from a POSIX timestamp.

classmethod utcnow()

Return a new datetime representing UTC day and time.

utcoffset()

Return self.tzinfo.utcoffset(self).

utctimetuple()

Return UTC time tuple, compatible with time.localtime().

nornir_buildmanager.pipelinemanager.isgenerator(object)[source]

Return true if the object is a generator.

Generator objects provide these attributes:

gi_code code object gi_frame frame object or possibly None once the generator has

been exhausted

gi_running set to 1 when generator is executing, 0 otherwise gi_suspended set to 1 when the generator is suspended at a yield point, 0 otherwise gi_yieldfrom object being iterated by yield from or None

__iter__() defined to support iteration over container close() raises a new GeneratorExit exception inside the

generator to terminate the iteration

send() resumes the generator and “sends” a value that becomes

the result of the current yield-expression

throw() used to raise an exception inside the generator

nornir_buildmanager.pipelinemanager.publish_run_event(event: str, **fields: Any) → None[source]

Publish a structured pipeline event to the run event topic.

Typical event values: stage_start, stage_end, stage_failed, iterate_progress. Extra fields (module, function, section, element, current, total, label, depth, track_id, …) are included in the JSON payload.

nornir_buildmanager.pipelinemanager.read_data(obj: SupportsRead) → bytes[source]
nornir_buildmanager.pipelinemanager.resolve_iterate_candidates(root_for_search: XElementWrapper, xpath: str, iterate_node: ElementTree.Element, arg_set: ArgumentSet, volume_elem: XElementWrapper, get_search_root: Any) → Iterator[XElementWrapper][source]

Yield iterate candidates using Require*-aware fetch when possible.

nornir_buildmanager.pipelinemanager.sort_iterate_candidates(candidates: Iterable[XElementWrapper], attribute: str) → list[XElementWrapper][source]

Return candidates ordered by attribute, numeric when the value is an int.

ExportAnnotationCrops uses this so a block stored high-Z first (RPC2) is visited in ascending section number, matching a block stored low-Z first.

class nornir_buildmanager.pipelinemanager.timezone

Bases: tzinfo

Fixed offset from UTC implementation of tzinfo.

dst(object, /)

Return None.

fromutc(object, /)

datetime in UTC -> datetime in local time.

max = datetime.timezone(datetime.timedelta(seconds=86340))
min = datetime.timezone(datetime.timedelta(days=-1, seconds=60))
tzname(object, /)

If name is specified when timezone is created, returns the name. Otherwise returns offset as ‘UTC(+|-)HH:MM’.

utc = datetime.timezone.utc
utcoffset(object, /)

Return fixed offset.