Node Details

Common Types

  • GrayScaleImage: single-channel image (numpy array)

  • ColorImage: three-channel image (numpy array)

  • Contours: list of OpenCV contours

  • String, Int, Float: basic scalar types

IDXNode

Inputs
  • None

Outputs
  • Idx (Int)

Parameters
  • None

Underlying functions
  • random.randint

SourceNode

Inputs
  • Offset (Int)

Outputs
  • Image (GrayScaleImage or ColorImage), repeated for n_frames

Parameters
  • n_frames (constructor): number of frames to output per compute (creates that many output sockets)

  • grayscale_mode (constructor): convert images to grayscale when True

  • enable_resize (constructor): downscale images larger than target_size

  • target_size (constructor): max (height, width) for resizing; larger images are resized to this size

Underlying functions
  • SourceManager.get_next_n_frames

  • cv2.resize (when resizing enabled)

ABSDiffNode

Inputs
  • Image 1 (GrayScaleImage)

  • Image 2 (GrayScaleImage)

Outputs
  • Result Image (GrayScaleImage)

Parameters
  • None

Underlying functions
  • cv2.absdiff

ThresholdNode

Inputs
  • Image 1 (GrayScaleImage)

  • Threshold value (Float)

  • New value (Int)

  • Type (ThresholdType)

Outputs
  • Result Image (GrayScaleImage)

  • Threshold value (Float)

  • Type (ThresholdType)

Parameters
  • Threshold value: min 0, max 255, default 10. Cutoff used by cv2.threshold

  • New value: min 0, max 255, default 255. Value assigned to pixels that pass the threshold

  • Type: default Binary. Thresholding mode (Binary, BinaryInv, Trunc, ToZero, ToZeroInv)

Underlying functions
  • cv2.threshold

InvertNode

Inputs
  • Image 1 (GrayScaleImage)

Outputs
  • Result Image (GrayScaleImage)

Parameters
  • None

Underlying functions
  • cv2.bitwise_not

MinNode

Inputs
  • Image 1..N (GrayScaleImage)

Outputs
  • Result Image (GrayScaleImage)

Parameters
  • n_inputs (constructor): number of input sockets to create for the min reduction

Underlying functions
  • numpy.minimum.reduce

MaxNode

Inputs
  • Image 1..N (GrayScaleImage)

Outputs
  • Result Image (GrayScaleImage)

Parameters
  • n_inputs (constructor): number of input sockets to create for the max reduction

Underlying functions
  • numpy.maximum.reduce

ClampedDiffNode

Inputs
  • Image 1 (GrayScaleImage)

  • Image 2 (GrayScaleImage)

  • Cutoff (Int)

Outputs
  • Result Image (GrayScaleImage)

Parameters
  • Cutoff: min 0, max 255, default 0. Values below this after (img1 - img2) are set to 0

Underlying functions
  • numpy subtraction and clipping

SplitChannelNode

Inputs
  • Image (ColorImage)

Outputs
  • Channel 1 (GrayScaleImage)

  • Channel 2 (GrayScaleImage)

  • Channel 3 (GrayScaleImage)

Parameters
  • None

Underlying functions
  • cv2.split

RegionOfInterestNode

Inputs
  • Image (GrayScaleImage)

  • x (Int)

  • y (Int)

  • width (Int)

  • height (Int)

Outputs
  • Result Image (GrayScaleImage)

Parameters
  • x: default 0. Left edge of the ROI in pixels

  • y: default 0. Top edge of the ROI in pixels

  • width: default -1 (full width). ROI width; <= 0 uses the remaining image width

  • height: default -1 (full height). ROI height; <= 0 uses the remaining image height

Underlying functions
  • numpy slicing

ErodeNode

Inputs
  • Image (GrayScaleImage)

  • kernelSize (Int)

  • iterations (Int)

Outputs
  • Result Image (GrayScaleImage)

Parameters
  • kernelSize: min 0, default 3. Size of the square erosion kernel in pixels

  • iterations: min 0, default 1. Number of erosion passes

Underlying functions
  • cv2.erode

DilateNode

Inputs
  • Image (GrayScaleImage)

  • kernelSize (Int)

  • iterations (Int)

Outputs
  • Result Image (GrayScaleImage)

Parameters
  • kernelSize: min 0, default 3. Size of the square dilation kernel in pixels

  • iterations: min 0, default 1. Number of dilation passes

Underlying functions
  • cv2.dilate

PixelwiseAnd

Inputs
  • Image 1 (GrayScaleImage)

  • Image 2 (GrayScaleImage)

Outputs
  • Result Image (GrayScaleImage)

Parameters
  • None

Underlying functions
  • cv2.bitwise_and

MorphologyOperationNode

Inputs
  • Image (GrayScaleImage)

  • operation (MorphologyTypes)

  • kernelSize (Int)

  • iterations (Int)

Outputs
  • Result Image (GrayScaleImage)

Parameters
  • operation: default Close. Morphology operation (Open, Close, Gradient, TopHat, BlackHat, etc.)

  • kernelSize: min 0, default 3. Size of the square morphology kernel in pixels

  • iterations: min 0, default 1. Number of morphology passes

Underlying functions
  • cv2.morphologyEx

FindContoursNode

Inputs
  • Input Image (GrayScaleImage)

  • Draw On Image (GrayScaleImage)

  • Mode (Int)

  • Method (Int)

  • Min Area (Int)

  • Draw Color R (Int)

  • Draw Color G (Int)

  • Draw Color B (Int)

  • Thickness (Int)

Outputs
  • Result Image (ColorImage)

  • Contour Count (Int)

  • Contours (Contours)

Parameters
  • Mode: default cv2.RETR_EXTERNAL. OpenCV contour retrieval mode

  • Method: default cv2.CHAIN_APPROX_SIMPLE. OpenCV contour approximation method

  • Min Area: min 0, max 10000, default 100. Filters out small contours by area

  • Draw Color: defaults R=0, G=255, B=0. RGB color used to draw contours

  • Thickness: min -1, max 50, default 2. Line thickness; -1 fills the contour

Underlying functions
  • cv2.findContours

  • cv2.contourArea

  • cv2.drawContours

  • cv2.cvtColor

SaveContourCropsNode

Inputs
  • Input Image (GrayScaleImage)

  • Contours (Contours)

  • Padding (Int)

  • Min Area (Int)

Outputs
  • Saved Count (Int)

  • Output Directory (String)

  • Status (String)

Parameters
  • Padding: min 0, max 100, default 5. Extra pixels added around each contour crop

  • Min Area: min 0, max 10000, default 100. Filters out small contours before saving

Underlying functions
  • cv2.contourArea

  • cv2.boundingRect

  • cv2.imwrite

  • json.dump

ClassificationNode

Inputs
  • Original Image (GrayScaleImage)

  • Crops Directory (String)

  • Entropy Threshold (Float)

  • Temperature (Float)

  • Batch Size (Int)

Outputs
  • Annotated Image (ColorImage)

  • Classification Count (Int)

  • Status (String)

Parameters
  • Entropy Threshold: min 0.0, max 5.0, default 1.0. Predictions above this entropy are marked as OOD

  • Temperature: min 0.1, max 3.0, default 1.5. Logit scaling before softmax; higher = softer probabilities

  • Batch Size: min 1, max 256, default 64. Number of crop images per inference batch

Underlying functions
  • transformers.ViTForImageClassification.from_pretrained

  • torch.utils.data.DataLoader

  • torch.nn.functional.softmax

  • cv2.rectangle, cv2.putText, cv2.cvtColor

  • json.load/json.dump

PlotContourAreaHistogramNode

Inputs
  • Contours (Contours)

  • Bins (Int)

  • Min Area (Int)

  • Max Area (Int)

  • Output Dir (String)

  • Filename Prefix (String)

Outputs
  • Histogram Image (ColorImage)

  • Saved Path (String)

  • Status (String)

Parameters
  • Bins: min 1, max 200, default 20. Number of histogram bins

  • Min Area: min 0, max 10_000_000, default 0 (auto). Lower bound for contour area filter

  • Max Area: min 0, max 10_000_000, default 0 (auto). Upper bound for contour area filter

  • Output Dir: directory where the histogram image is saved

  • Filename Prefix: prefix used for the saved histogram file name

Underlying functions
  • matplotlib.pyplot.hist

  • cv2.imwrite

DeconvolutionNode

Inputs
  • Input Image (GrayScaleImage)

  • Batch Size (Int)

  • Min StdDev (Float)

Outputs
  • Deconvolved Image (GrayScaleImage)

  • Status (String)

Parameters
  • Batch Size: min 1, max 32, default 4. Reserved for future batching; current implementation processes one image at a time

  • Min StdDev: min 0.0, max 100.0, default 2.0. Skip deconvolution when image contrast is below this threshold

Underlying functions
  • LUCYD model (diplo_lib/core/lucyd.py)

  • torch (cuda/mps selection, no_grad)

PlotClassificationHistogramNode

Inputs
  • Crops Directory (String)

  • Bins (Int)

  • Min Area (Int)

  • Max Area (Int)

  • Output Dir (String)

  • Filename Prefix (String)

Outputs
  • Histogram Image (ColorImage)

  • Saved Path (String)

  • Status (String)

Parameters
  • Bins: min 1, max 200, default 20. Number of histogram bins

  • Min Area: min 0, max 10_000_000, default 0 (auto). Lower bound for contour area filter

  • Max Area: min 0, max 10_000_000, default 0 (auto). Upper bound for contour area filter

  • Output Dir: directory where the histogram image is saved

  • Filename Prefix: prefix used for the saved histogram file name

Underlying functions
  • json.load

  • numpy.histogram

  • matplotlib.pyplot.bar

  • cv2.imwrite

CalculateRegionPropsNode

Inputs
  • Input Image (GrayScaleImage)

  • Contours (Contours)

  • Min Area (Int)

  • Output CSV (String)

Outputs
  • Annotated Image (ColorImage)

  • Properties Count (Int)

  • CSV Path (String)

  • Status (String)

Parameters
  • Min Area: min 0, max 10000, default 100. Filters out small contours before computing properties

  • Output CSV: path where the properties table is saved

Underlying functions
  • skimage.measure.label

  • skimage.measure.regionprops

  • cv2.drawContours, cv2.boundingRect, cv2.putText

  • csv.DictWriter