Skip to content

Remove the stopgap MeshReadNode.image scalar port #22

Description

@csparker247

Background

MeshReadNode (graph layer) exposes both a plural images output port (the canonical texture output, a std::vector<cv::Mat> indexed by UV chart) and a singular image output port. As of #21, image is an explicitly-documented stopgap scalar convenience, backed by a getter lambda that returns images[0] (or an empty cv::Mat when the mesh has no textures).

It exists only because some downstream single-image consumers can't yet accept the image vector directly. Its only consumer today is Register.cpp (the 2D→3D fixed image), which feeds a registration subgraph that is scalar all the way through (LandmarkDetectorNode, ImageResampleNode, DeformableRegistrationNode, TransformUVMapNode — all take InputPort<cv::Mat>).

Goal

Remove the image port so the reader's output contract is purely plural (images), and let each consumer decide its own arity at its input boundary.

Approach

smgl input ports can be lambda-/callback-backed (see ReorderTextureNode::imagesIn wiring ReorderUnorganizedTexture::setTextureMats, and MeshWriteNode's image/imageSource ports), so a consumer that only needs one texture can accept the plural std::vector<cv::Mat> and collapse to [0] internally. The registration fan-out makes this non-trivial: results["fixedImage"] is a single OutputPort<cv::Mat>* shared across the 2D→3D and 2D→2D branches and wired into several scalar input ports. Bridging the plural reader to that fan-out likely wants a small reusable adapter node (plural lambda-backed input + index → scalar image output), rather than pushing vectors through the (inherently single-image) registration nodes.

Done when

  • MeshReadNode.image (and its getter lambda) is removed; images is the only texture output.
  • Register.cpp and any other single-image consumers are migrated (via a select/index adapter or plural-accepting input ports).
  • Build + tests pass.

Follow-up to #21.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions