7#include <opencv2/core.hpp>
8#include <smgl/Node.hpp>
11#include "vc/core/io/ImageIO.hpp"
12#include "vc/core/io/MeshIO.hpp"
40 smgl::InputPort<filesystem::path>
path;
42 smgl::OutputPort<VolumePkg::Pointer>
volpkg;
50 -> smgl::Metadata
override;
54 const smgl::Metadata& meta,
55 const filesystem::path& )
override;
71 smgl::InputPort<VolumePkg::Pointer>
volpkg;
73 smgl::OutputPort<std::string>
name;
100 smgl::InputPort<VolumePkg::Pointer>
volpkg;
102 smgl::InputPort<Volume::Identifier>
id;
104 smgl::OutputPort<Volume::Pointer>
volume;
112 -> smgl::Metadata
override;
116 const smgl::Metadata& meta,
117 const filesystem::path& )
override;
157 -> smgl::Metadata
override;
161 const smgl::Metadata& meta,
162 const filesystem::path& )
override;
182 smgl::InputPort<VolumePkg::Pointer>
volpkg;
184 smgl::InputPort<Segmentation::Identifier>
id;
194 -> smgl::Metadata
override;
198 const smgl::Metadata& meta,
199 const filesystem::path& )
override;
264 smgl::InputPort<filesystem::path>
path;
268 smgl::OutputPort<ITKMesh::Pointer>
mesh;
270 smgl::OutputPort<UVMap::Pointer>
uvMap;
279 auto serialize_(
bool useCache,
const filesystem::path& cacheDir)
280 -> smgl::Metadata
override;
284 const smgl::Metadata& meta,
285 const filesystem::path& )
override;
310 smgl::InputPort<filesystem::path>
path;
312 smgl::InputPort<ITKMesh::Pointer>
mesh;
314 smgl::InputPort<UVMap::Pointer>
uvMap;
325 auto serialize_(
bool useCache,
const filesystem::path& cacheDir)
326 -> smgl::Metadata
override;
330 const smgl::Metadata& meta,
331 const filesystem::path& )
override;
366 auto serialize_(
bool useCache,
const filesystem::path& cacheDir)
367 -> smgl::Metadata
override;
371 const smgl::Metadata& meta,
const filesystem::path& cacheDir)
override;
406 auto serialize_(
bool useCache,
const filesystem::path& cacheDir)
407 -> smgl::Metadata
override;
411 const smgl::Metadata& meta,
const filesystem::path& cacheDir)
override;
438 smgl::InputPort<ITKMesh::Pointer>
mesh;
440 smgl::InputPort<UVMap::AlignmentAxis>
axis;
449 auto serialize_(
bool useCache,
const filesystem::path& cacheDir)
450 -> smgl::Metadata
override;
454 const smgl::Metadata& meta,
const filesystem::path& cacheDir)
override;
475 smgl::InputPort<UVMap::Pointer>
uvMap;
477 smgl::InputPort<ITKMesh::Pointer>
uvMesh;
479 smgl::OutputPort<cv::Mat>
plot;
486 auto serialize_(
bool useCache,
const filesystem::path& cacheDir)
487 -> smgl::Metadata
override;
491 const smgl::Metadata& meta,
const filesystem::path& cacheDir)
override;
512 smgl::InputPort<filesystem::path>
path;
523 auto serialize_(
bool useCache,
const filesystem::path& cacheDir)
524 -> smgl::Metadata
override;
528 const smgl::Metadata& meta,
529 const filesystem::path& )
override;
552 smgl::InputPort<filesystem::path>
path;
565 auto serialize_(
bool useCache,
const filesystem::path& cacheDir)
566 -> smgl::Metadata
override;
570 const smgl::Metadata& meta,
571 const filesystem::path& )
override;
596 smgl::InputPort<filesystem::path>
path;
609 auto serialize_(
bool useCache,
const filesystem::path& cacheDir)
610 -> smgl::Metadata
override;
614 const smgl::Metadata& meta,
615 const filesystem::path& )
override;
636 smgl::InputPort<filesystem::path>
path;
640 smgl::OutputPort<PerPixelMap::Pointer>
ppm;
647 auto serialize_(
bool useCache,
const filesystem::path& cacheDir)
648 -> smgl::Metadata
override;
652 const smgl::Metadata& meta,
653 const filesystem::path& )
override;
674 smgl::InputPort<filesystem::path>
path;
676 smgl::InputPort<PerPixelMap::Pointer>
ppm;
685 auto serialize_(
bool useCache,
const filesystem::path& cacheDir)
686 -> smgl::Metadata
override;
690 const smgl::Metadata& meta,
691 const filesystem::path& )
override;
706 smgl::InputPort<PerPixelMap::Pointer>
ppm;
712 smgl::OutputPort<cv::Mat>
mask;
739 smgl::InputPort<filesystem::path>
path;
750 auto serialize_(
bool useCache,
const filesystem::path& cacheDir)
751 -> smgl::Metadata
override;
755 const smgl::Metadata& meta,
756 const filesystem::path& )
override;
777 smgl::InputPort<filesystem::path>
path;
788 auto serialize_(
bool useCache,
const filesystem::path& cacheDir)
789 -> smgl::Metadata
override;
793 const smgl::Metadata& meta,
794 const filesystem::path& )
override;
816 smgl::InputPort<VolumePkg::Pointer>
volpkg;
818 smgl::InputPort<Transform3D::Identifier>
id;
828 -> smgl::Metadata
override;
832 const smgl::Metadata& meta,
833 const filesystem::path& )
override;
854 smgl::InputPort<Transform3D::Pointer>
input;
856 smgl::OutputPort<Transform3D::Pointer>
output;
863 auto serialize_(
bool useCache,
const filesystem::path& cacheDir)
864 -> smgl::Metadata
override;
868 const smgl::Metadata& meta,
const filesystem::path& cacheDir)
override;
891 smgl::InputPort<Transform3D::Pointer> transform{&
tfm_};
892 smgl::OutputPort<T> output{&
output_};
897 registerInputPort(
"input",
input);
898 registerInputPort(
"transform", transform);
899 registerOutputPort(
"output", output);
910 auto serialize_(
bool useCache,
const filesystem::path& cacheDir)
911 -> smgl::Metadata
override
914 if (useCache and
tfm_) {
916 meta[
"transform"] =
"transform.json";
923 const smgl::Metadata& meta,
const filesystem::path& cacheDir)
override
925 if (meta.contains(
"transform")) {
926 auto tfmFile = meta[
"transform"].get<std::string>();
944 auto serialize_(
bool useCache,
const filesystem::path& cacheDir)
945 -> smgl::Metadata
override;
949 const smgl::Metadata& meta,
const filesystem::path& cacheDir)
override;
964 auto serialize_(
bool useCache,
const filesystem::path& cacheDir)
965 -> smgl::Metadata
override;
969 const smgl::Metadata& meta,
const filesystem::path& cacheDir)
override;
Rotate a UVMap to align a specified volume axis to the -V direction of UV space.
smgl::InputPort< UVMap::AlignmentAxis > axis
Volume axis to use for alignment.
smgl::InputPort< ITKMesh::Pointer > mesh
Input mesh, used to orient in volume space.
auto serialize_(bool useCache, const filesystem::path &cacheDir) -> smgl::Metadata override
smgl::OutputPort< UVMap::Pointer > uvMapOut
Output UVMap.
smgl::InputPort< UVMap::Pointer > uvMapIn
Input UVMap.
void deserialize_(const smgl::Metadata &meta, const filesystem::path &cacheDir) override
UVMap::AlignmentAxis axis_
std::string Identifier
Identifier type.
Flip a UVMap across one or both of its axes.
smgl::InputPort< FlipAxis > flipAxis
Flip axis.
auto serialize_(bool useCache, const filesystem::path &cacheDir) -> smgl::Metadata override
void deserialize_(const smgl::Metadata &meta, const filesystem::path &cacheDir) override
smgl::OutputPort< UVMap::Pointer > uvMapOut
Output UVMap.
smgl::InputPort< UVMap::Pointer > uvMapIn
Input UVMap.
Read an image from the specified path.
smgl::InputPort< bool > cacheArgs
Include the loaded file in the graph cache.
smgl::InputPort< filesystem::path > path
Input path.
smgl::OutputPort< cv::Mat > image
Loaded image.
void deserialize_(const smgl::Metadata &meta, const filesystem::path &) override
auto serialize_(bool useCache, const filesystem::path &cacheDir) -> smgl::Metadata override
auto serialize_(bool useCache, const filesystem::path &cacheDir) -> smgl::Metadata override
smgl::OutputPort< cv::Mat > texture
Loaded texture image.
void deserialize_(const smgl::Metadata &meta, const filesystem::path &) override
smgl::InputPort< bool > cacheArgs
Include the loaded file in the graph cache.
smgl::OutputPort< ITKMesh::Pointer > mesh
Loaded mesh.
smgl::OutputPort< UVMap::Pointer > uvMap
Loaded UV map.
smgl::InputPort< filesystem::path > path
Input path.
Read a PerPixelMap from disk.
auto serialize_(bool useCache, const filesystem::path &cacheDir) -> smgl::Metadata override
smgl::OutputPort< PerPixelMap::Pointer > ppm
Loaded PerPixelMap.
smgl::InputPort< filesystem::path > path
Input path.
smgl::InputPort< bool > cacheArgs
Include the loaded file in the graph cache.
PerPixelMap::Pointer ppm_
void deserialize_(const smgl::Metadata &meta, const filesystem::path &) override
Load a VolumePkg from disk.
auto serialize_(bool, const filesystem::path &) -> smgl::Metadata override
smgl::OutputPort< VolumePkg::Pointer > volpkg
Loaded VolPkg.
void deserialize_(const smgl::Metadata &meta, const filesystem::path &) override
smgl::InputPort< filesystem::path > path
VolPkg path.
Load a VolumetricMask from a .vcps file.
smgl::InputPort< bool > cacheArgs
Include the loaded file in the graph cache.
void deserialize_(const smgl::Metadata &meta, const filesystem::path &) override
VolumetricMask::Pointer mask_
auto serialize_(bool useCache, const filesystem::path &cacheDir) -> smgl::Metadata override
smgl::OutputPort< VolumetricMask::Pointer > volumetricMask
Loaded VolumetricMask.
smgl::InputPort< filesystem::path > path
Input path.
Retrieve Mesh properties (e.g. number of vertices, number of faces, etc.)
smgl::OutputPort< std::size_t > numVertices
Number of vertices in the mesh.
smgl::InputPort< ITKMesh::Pointer > mesh
Input mesh.
smgl::OutputPort< std::size_t > numFaces
Number of faces in the mesh.
Retrieve PerPixelMap properties (e.g. mask, cell map, etc.)
smgl::OutputPort< cv::Mat > mask
Get the pixel mask.
PerPixelMap::Pointer ppm_
smgl::OutputPort< cv::Mat > cellMap
Get the cell map image.
smgl::InputPort< PerPixelMap::Pointer > ppm
Input PerPixelMap.
std::shared_ptr< PerPixelMap > Pointer
Plot the UV points on an image.
auto serialize_(bool useCache, const filesystem::path &cacheDir) -> smgl::Metadata override
smgl::InputPort< UVMap::Pointer > uvMap
Input UVMap.
smgl::OutputPort< cv::Mat > plot
Plot image.
smgl::InputPort< ITKMesh::Pointer > uvMesh
Input mesh.
void deserialize_(const smgl::Metadata &meta, const filesystem::path &cacheDir) override
Rotate a UVMap by a multiple of 90 degrees.
smgl::InputPort< UVMap::Pointer > uvMapIn
Input UVMap.
smgl::OutputPort< UVMap::Pointer > uvMapOut
Output UVMap.
smgl::InputPort< double > theta
Rotation angle, in degrees.
void deserialize_(const smgl::Metadata &meta, const filesystem::path &cacheDir) override
auto serialize_(bool useCache, const filesystem::path &cacheDir) -> smgl::Metadata override
Retrieve Segmentation properties (e.g. pointset)
smgl::OutputPort< Segmentation::PointSet > pointSet
Load the associated PointSet from the Segmentation file.
smgl::InputPort< Segmentation::Pointer > segmentation
Input segmentation.
Segmentation::Pointer seg_
SegmentationPropertiesNode()
Get a Segmentation by uuid.
smgl::InputPort< Segmentation::Identifier > id
Segmentation UUID.
Segmentation::Pointer seg_
auto serialize_(bool, const filesystem::path &) -> smgl::Metadata override
void deserialize_(const smgl::Metadata &meta, const filesystem::path &) override
smgl::InputPort< VolumePkg::Pointer > volpkg
Input VolumePkg.
smgl::OutputPort< Segmentation::Pointer > segmentation
Segmentation.
Segmentation::Identifier id_
SegmentationSelectorNode()
std::shared_ptr< Segmentation > Pointer
std::shared_ptr< UVMap > Pointer
Retrieve VolumePkg properties (e.g. name, version, etc.)
smgl::InputPort< VolumePkg::Pointer > volpkg
Input VolumePkg.
VolumePkgPropertiesNode()
smgl::OutputPort< std::string > name
Returns the identifying name of the VolumePkg.
smgl::OutputPort< int > version
Returns the VolumePkg version.
smgl::OutputPort< double > materialThickness
Returns the approx. thickness of a material layer in microns (um).
std::shared_ptr< VolumePkg > Pointer
Set/Retrieve Volume properties (voxel size, bounds, etc.)
smgl::InputPort< std::size_t > cacheMemory
Set the maximum size of the cache in bytes.
void deserialize_(const smgl::Metadata &meta, const filesystem::path &) override
smgl::OutputPort< Volume::Pointer > volumeOut
Output Volume.
smgl::InputPort< Volume::Pointer > volumeIn
Input Volume.
auto serialize_(bool, const filesystem::path &) -> smgl::Metadata override
smgl::OutputPort< double > voxelSize
Get the voxel size (in microns)
smgl::OutputPort< Volume::Bounds > bounds
Get the bounding box.
smgl::InputPort< Volume::Identifier > id
Volume UUID.
smgl::InputPort< VolumePkg::Pointer > volpkg
Input VolumePkg.
auto serialize_(bool, const filesystem::path &) -> smgl::Metadata override
smgl::OutputPort< Volume::Pointer > volume
Volume.
void deserialize_(const smgl::Metadata &meta, const filesystem::path &) override
std::shared_ptr< Volume > Pointer
std::shared_ptr< VolumetricMask > Pointer
Write image to the specified path.
smgl::InputPort< bool > cacheArgs
Include the saved file in the graph cache.
auto serialize_(bool useCache, const filesystem::path &cacheDir) -> smgl::Metadata override
smgl::InputPort< cv::Mat > image
Output image.
smgl::InputPort< WriteImageOpts > options
Image writer options.
smgl::InputPort< filesystem::path > path
Output file.
void deserialize_(const smgl::Metadata &meta, const filesystem::path &) override
smgl::InputPort< bool > cacheArgs
Include the saved file in the graph cache.
std::vector< cv::Mat > ImageSequence
smgl::InputPort< filesystem::path > path
Output file.
void deserialize_(const smgl::Metadata &meta, const filesystem::path &) override
smgl::InputPort< WriteImageOpts > options
Image writer options.
smgl::InputPort< ImageSequence > images
Output image sequence.
auto serialize_(bool useCache, const filesystem::path &cacheDir) -> smgl::Metadata override
void deserialize_(const smgl::Metadata &meta, const filesystem::path &) override
smgl::InputPort< bool > cacheArgs
Include the saved file in the graph cache.
smgl::InputPort< filesystem::path > path
Output file.
smgl::InputPort< cv::Mat > texture
Texture image.
auto serialize_(bool useCache, const filesystem::path &cacheDir) -> smgl::Metadata override
smgl::InputPort< UVMap::Pointer > uvMap
UV map.
smgl::InputPort< ITKMesh::Pointer > mesh
Mesh.
Write a PerPixelMap to disk.
void deserialize_(const smgl::Metadata &meta, const filesystem::path &) override
smgl::InputPort< PerPixelMap::Pointer > ppm
Output PerPixelMap.
smgl::InputPort< filesystem::path > path
Output file.
PerPixelMap::Pointer ppm_
auto serialize_(bool useCache, const filesystem::path &cacheDir) -> smgl::Metadata override
smgl::InputPort< bool > cacheArgs
Include the saved file in the graph cache.
Volume Cartographer library
auto ApplyTransform(const ITKMesh::Pointer &mesh, const Transform3D::Pointer &transform, bool normalize=true) -> ITKMesh::Pointer
Apply a transform to an ITKMesh.