Volume Cartographer 2.27.0
core.hpp
Go to the documentation of this file.
1#pragma once
2
5#include <cstddef>
6
7#include <opencv2/core.hpp>
8#include <smgl/Node.hpp>
9
11#include "vc/core/io/ImageIO.hpp"
12#include "vc/core/io/MeshIO.hpp"
21
22namespace volcart
23{
24
30class LoadVolumePkgNode : public smgl::Node
31{
32private:
34 filesystem::path path_{};
37
38public:
40 smgl::InputPort<filesystem::path> path;
42 smgl::OutputPort<VolumePkg::Pointer> volpkg;
43
46
47private:
49 auto serialize_(bool /*useCache*/, const filesystem::path& /*cacheDir*/)
50 -> smgl::Metadata override;
51
54 const smgl::Metadata& meta,
55 const filesystem::path& /*cacheDir*/) override;
56};
57
63class VolumePkgPropertiesNode : public smgl::Node
64{
65private:
68
69public:
71 smgl::InputPort<VolumePkg::Pointer> volpkg;
73 smgl::OutputPort<std::string> name;
75 smgl::OutputPort<int> version;
77 smgl::OutputPort<double> materialThickness;
78
81};
82
88class VolumeSelectorNode : public smgl::Node
89{
90private:
97
98public:
100 smgl::InputPort<VolumePkg::Pointer> volpkg;
102 smgl::InputPort<Volume::Identifier> id;
104 smgl::OutputPort<Volume::Pointer> volume;
105
108
109private:
111 auto serialize_(bool /*useCache*/, const filesystem::path& /*cacheDir*/)
112 -> smgl::Metadata override;
113
116 const smgl::Metadata& meta,
117 const filesystem::path& /*cacheDir*/) override;
118};
119
125class VolumePropertiesNode : public smgl::Node
126{
127private:
131 std::size_t cacheMem_{2'000'000'000};
132
133public:
135 smgl::InputPort<Volume::Pointer> volumeIn;
137 smgl::InputPort<std::size_t> cacheMemory;
138
140 smgl::OutputPort<Volume::Bounds> bounds;
142 smgl::OutputPort<double> voxelSize;
149 smgl::OutputPort<Volume::Pointer> volumeOut;
150
153
154private:
156 auto serialize_(bool /*useCache*/, const filesystem::path& /*cacheDir*/)
157 -> smgl::Metadata override;
158
161 const smgl::Metadata& meta,
162 const filesystem::path& /*cacheDir*/) override;
163};
164
170class SegmentationSelectorNode : public smgl::Node
171{
172private:
179
180public:
182 smgl::InputPort<VolumePkg::Pointer> volpkg;
184 smgl::InputPort<Segmentation::Identifier> id;
186 smgl::OutputPort<Segmentation::Pointer> segmentation;
187
190
191private:
193 auto serialize_(bool /*useCache*/, const filesystem::path& /*cacheDir*/)
194 -> smgl::Metadata override;
195
198 const smgl::Metadata& meta,
199 const filesystem::path& /*cacheDir*/) override;
200};
201
207class SegmentationPropertiesNode : public smgl::Node
208{
211
212public:
214 smgl::InputPort<Segmentation::Pointer> segmentation;
216 smgl::OutputPort<Segmentation::PointSet> pointSet;
217
220};
221
228class MeshPropertiesNode : public smgl::Node
229{
230private:
232 ITKMesh::Pointer mesh_{nullptr};
233
234public:
236 smgl::InputPort<ITKMesh::Pointer> mesh{&mesh_};
238 smgl::OutputPort<std::size_t> numVertices;
240 smgl::OutputPort<std::size_t> numFaces;
241
244};
245
252class LoadMeshNode : public smgl::Node
253{
254private:
256 filesystem::path path_{};
258 bool cacheArgs_{false};
261
262public:
264 smgl::InputPort<filesystem::path> path;
266 smgl::InputPort<bool> cacheArgs;
268 smgl::OutputPort<ITKMesh::Pointer> mesh;
270 smgl::OutputPort<UVMap::Pointer> uvMap;
272 smgl::OutputPort<cv::Mat> texture;
273
276
277private:
279 auto serialize_(bool useCache, const filesystem::path& cacheDir)
280 -> smgl::Metadata override;
281
284 const smgl::Metadata& meta,
285 const filesystem::path& /*cacheDir*/) override;
286};
287
294class WriteMeshNode : public smgl::Node
295{
296private:
298 filesystem::path path_{};
300 ITKMesh::Pointer mesh_{nullptr};
304 cv::Mat texture_{};
306 bool cacheArgs_{false};
307
308public:
310 smgl::InputPort<filesystem::path> path;
312 smgl::InputPort<ITKMesh::Pointer> mesh;
314 smgl::InputPort<UVMap::Pointer> uvMap;
316 smgl::InputPort<cv::Mat> texture;
318 smgl::InputPort<bool> cacheArgs;
319
322
323private:
325 auto serialize_(bool useCache, const filesystem::path& cacheDir)
326 -> smgl::Metadata override;
327
330 const smgl::Metadata& meta,
331 const filesystem::path& /*cacheDir*/) override;
332};
333
343class RotateUVMapNode : public smgl::Node
344{
345private:
349 double theta_{0};
352
353public:
355 smgl::InputPort<UVMap::Pointer> uvMapIn;
357 smgl::InputPort<double> theta;
359 smgl::OutputPort<UVMap::Pointer> uvMapOut;
360
363
364private:
366 auto serialize_(bool useCache, const filesystem::path& cacheDir)
367 -> smgl::Metadata override;
368
371 const smgl::Metadata& meta, const filesystem::path& cacheDir) override;
372};
373
381class FlipUVMapNode : public smgl::Node
382{
383private:
387 UVMap::FlipAxis axis_{UVMap::FlipAxis::Vertical};
390
391public:
395 smgl::InputPort<UVMap::Pointer> uvMapIn;
397 smgl::InputPort<FlipAxis> flipAxis;
399 smgl::OutputPort<UVMap::Pointer> uvMapOut;
400
403
404private:
406 auto serialize_(bool useCache, const filesystem::path& cacheDir)
407 -> smgl::Metadata override;
408
411 const smgl::Metadata& meta, const filesystem::path& cacheDir) override;
412};
413
422class AlignUVMapToAxisNode : public smgl::Node
423{
424private:
428 ITKMesh::Pointer mesh_;
430 UVMap::AlignmentAxis axis_{UVMap::AlignmentAxis::ZPos};
433
434public:
436 smgl::InputPort<UVMap::Pointer> uvMapIn;
438 smgl::InputPort<ITKMesh::Pointer> mesh;
440 smgl::InputPort<UVMap::AlignmentAxis> axis;
442 smgl::OutputPort<UVMap::Pointer> uvMapOut;
443
446
447private:
449 auto serialize_(bool useCache, const filesystem::path& cacheDir)
450 -> smgl::Metadata override;
451
454 const smgl::Metadata& meta, const filesystem::path& cacheDir) override;
455};
456
463class PlotUVMapNode : public smgl::Node
464{
465private:
469 ITKMesh::Pointer uvMesh_;
471 cv::Mat plot_;
472
473public:
475 smgl::InputPort<UVMap::Pointer> uvMap;
477 smgl::InputPort<ITKMesh::Pointer> uvMesh;
479 smgl::OutputPort<cv::Mat> plot;
480
483
484private:
486 auto serialize_(bool useCache, const filesystem::path& cacheDir)
487 -> smgl::Metadata override;
488
491 const smgl::Metadata& meta, const filesystem::path& cacheDir) override;
492};
493
500class LoadImageNode : public smgl::Node
501{
502private:
504 filesystem::path path_{};
506 bool cacheArgs_{false};
508 cv::Mat image_{};
509
510public:
512 smgl::InputPort<filesystem::path> path;
514 smgl::InputPort<bool> cacheArgs;
516 smgl::OutputPort<cv::Mat> image;
517
520
521private:
523 auto serialize_(bool useCache, const filesystem::path& cacheDir)
524 -> smgl::Metadata override;
525
528 const smgl::Metadata& meta,
529 const filesystem::path& /*cacheDir*/) override;
530};
531
538class WriteImageNode : public smgl::Node
539{
540private:
542 filesystem::path path_{};
544 cv::Mat image_{};
548 bool cacheArgs_{false};
549
550public:
552 smgl::InputPort<filesystem::path> path;
554 smgl::InputPort<cv::Mat> image;
556 smgl::InputPort<WriteImageOpts> options;
558 smgl::InputPort<bool> cacheArgs;
559
562
563private:
565 auto serialize_(bool useCache, const filesystem::path& cacheDir)
566 -> smgl::Metadata override;
567
570 const smgl::Metadata& meta,
571 const filesystem::path& /*cacheDir*/) override;
572};
573
580class WriteImageSequenceNode : public smgl::Node
581{
582private:
584 using ImageSequence = std::vector<cv::Mat>;
586 filesystem::path path_{};
592 bool cacheArgs_{false};
593
594public:
596 smgl::InputPort<filesystem::path> path;
598 smgl::InputPort<ImageSequence> images;
600 smgl::InputPort<WriteImageOpts> options;
602 smgl::InputPort<bool> cacheArgs;
603
606
607private:
609 auto serialize_(bool useCache, const filesystem::path& cacheDir)
610 -> smgl::Metadata override;
611
614 const smgl::Metadata& meta,
615 const filesystem::path& /*cacheDir*/) override;
616};
617
624class LoadPPMNode : public smgl::Node
625{
626private:
628 filesystem::path path_{};
630 bool cacheArgs_{false};
633
634public:
636 smgl::InputPort<filesystem::path> path;
638 smgl::InputPort<bool> cacheArgs;
640 smgl::OutputPort<PerPixelMap::Pointer> ppm;
641
644
645private:
647 auto serialize_(bool useCache, const filesystem::path& cacheDir)
648 -> smgl::Metadata override;
649
652 const smgl::Metadata& meta,
653 const filesystem::path& /*cacheDir*/) override;
654};
655
662class WritePPMNode : public smgl::Node
663{
664private:
666 filesystem::path path_{};
670 bool cacheArgs_{false};
671
672public:
674 smgl::InputPort<filesystem::path> path;
676 smgl::InputPort<PerPixelMap::Pointer> ppm;
678 smgl::InputPort<bool> cacheArgs;
679
682
683private:
685 auto serialize_(bool useCache, const filesystem::path& cacheDir)
686 -> smgl::Metadata override;
687
690 const smgl::Metadata& meta,
691 const filesystem::path& /*cacheDir*/) override;
692};
693
698class PPMPropertiesNode : public smgl::Node
699{
700private:
703
704public:
706 smgl::InputPort<PerPixelMap::Pointer> ppm;
712 smgl::OutputPort<cv::Mat> mask;
714 smgl::OutputPort<cv::Mat> cellMap;
715
718};
719
727class LoadVolumetricMaskNode : public smgl::Node
728{
729private:
731 filesystem::path path_{};
733 bool cacheArgs_{false};
736
737public:
739 smgl::InputPort<filesystem::path> path;
741 smgl::InputPort<bool> cacheArgs;
743 smgl::OutputPort<VolumetricMask::Pointer> volumetricMask;
744
747
748private:
750 auto serialize_(bool useCache, const filesystem::path& cacheDir)
751 -> smgl::Metadata override;
752
755 const smgl::Metadata& meta,
756 const filesystem::path& /*cacheDir*/) override;
757};
758
765class LoadTransformNode : public smgl::Node
766{
767private:
769 filesystem::path path_{};
771 bool cacheArgs_{false};
774
775public:
777 smgl::InputPort<filesystem::path> path;
779 smgl::InputPort<bool> cacheArgs;
781 smgl::OutputPort<Transform3D::Pointer> transform;
782
785
786private:
788 auto serialize_(bool useCache, const filesystem::path& cacheDir)
789 -> smgl::Metadata override;
790
793 const smgl::Metadata& meta,
794 const filesystem::path& /*cacheDir*/) override;
795};
796
804class TransformSelectorNode : public smgl::Node
805{
806private:
813
814public:
816 smgl::InputPort<VolumePkg::Pointer> volpkg;
818 smgl::InputPort<Transform3D::Identifier> id;
820 smgl::OutputPort<Transform3D::Pointer> transform;
821
824
825private:
827 auto serialize_(bool /*useCache*/, const filesystem::path& /*cacheDir*/)
828 -> smgl::Metadata override;
829
832 const smgl::Metadata& meta,
833 const filesystem::path& /*cacheDir*/) override;
834};
835
844class InvertTransformNode : public smgl::Node
845{
846private:
851
852public:
854 smgl::InputPort<Transform3D::Pointer> input;
856 smgl::OutputPort<Transform3D::Pointer> output;
857
860
861private:
863 auto serialize_(bool useCache, const filesystem::path& cacheDir)
864 -> smgl::Metadata override;
865
868 const smgl::Metadata& meta, const filesystem::path& cacheDir) override;
869};
870
877template <class T>
878class ApplyTransformNode : public smgl::Node
879{
880protected:
887
888public:
890 smgl::InputPort<T> input{&input_};
891 smgl::InputPort<Transform3D::Pointer> transform{&tfm_};
892 smgl::OutputPort<T> output{&output_};
893
895 ApplyTransformNode() : Node{true}
896 {
897 registerInputPort("input", input);
898 registerInputPort("transform", transform);
899 registerOutputPort("output", output);
900
901 compute = [&]() {
902 if (tfm_) {
904 }
905 };
906 }
907
908protected:
910 auto serialize_(bool useCache, const filesystem::path& cacheDir)
911 -> smgl::Metadata override
912 {
913 smgl::Metadata meta;
914 if (useCache and tfm_) {
915 Transform3D::Save(cacheDir / "transform.json", tfm_);
916 meta["transform"] = "transform.json";
917 }
918 return meta;
919 }
920
923 const smgl::Metadata& meta, const filesystem::path& cacheDir) override
924 {
925 if (meta.contains("transform")) {
926 auto tfmFile = meta["transform"].get<std::string>();
927 tfm_ = Transform3D::Load(cacheDir / tfmFile);
928 }
929 }
930};
931
937class TransformMeshNode : public ApplyTransformNode<ITKMesh::Pointer>
938{
939private:
942
944 auto serialize_(bool useCache, const filesystem::path& cacheDir)
945 -> smgl::Metadata override;
946
949 const smgl::Metadata& meta, const filesystem::path& cacheDir) override;
950};
951
957class TransformPPMNode : public ApplyTransformNode<PerPixelMap::Pointer>
958{
959private:
962
964 auto serialize_(bool useCache, const filesystem::path& cacheDir)
965 -> smgl::Metadata override;
966
969 const smgl::Metadata& meta, const filesystem::path& cacheDir) override;
970};
971
972} // namespace volcart
Rotate a UVMap to align a specified volume axis to the -V direction of UV space.
Definition: core.hpp:423
UVMap::Pointer uvMapOut_
Definition: core.hpp:432
smgl::InputPort< UVMap::AlignmentAxis > axis
Volume axis to use for alignment.
Definition: core.hpp:440
UVMap::Pointer uvMapIn_
Definition: core.hpp:426
smgl::InputPort< ITKMesh::Pointer > mesh
Input mesh, used to orient in volume space.
Definition: core.hpp:438
auto serialize_(bool useCache, const filesystem::path &cacheDir) -> smgl::Metadata override
smgl::OutputPort< UVMap::Pointer > uvMapOut
Output UVMap.
Definition: core.hpp:442
smgl::InputPort< UVMap::Pointer > uvMapIn
Input UVMap.
Definition: core.hpp:436
void deserialize_(const smgl::Metadata &meta, const filesystem::path &cacheDir) override
ITKMesh::Pointer mesh_
Definition: core.hpp:428
UVMap::AlignmentAxis axis_
Definition: core.hpp:430
Template node for applying 3D transforms to objects.
Definition: core.hpp:879
Transform3D::Pointer tfm_
Definition: core.hpp:884
auto serialize_(bool useCache, const filesystem::path &cacheDir) -> smgl::Metadata override
Definition: core.hpp:910
void deserialize_(const smgl::Metadata &meta, const filesystem::path &cacheDir) override
Definition: core.hpp:922
smgl::InputPort< T > input
Input path.
Definition: core.hpp:890
Flip a UVMap across one or both of its axes.
Definition: core.hpp:382
smgl::InputPort< FlipAxis > flipAxis
Flip axis.
Definition: core.hpp:397
auto serialize_(bool useCache, const filesystem::path &cacheDir) -> smgl::Metadata override
UVMap::Pointer uvMapOut_
Definition: core.hpp:389
void deserialize_(const smgl::Metadata &meta, const filesystem::path &cacheDir) override
smgl::OutputPort< UVMap::Pointer > uvMapOut
Output UVMap.
Definition: core.hpp:399
smgl::InputPort< UVMap::Pointer > uvMapIn
Input UVMap.
Definition: core.hpp:395
UVMap::Pointer uvMapIn_
Definition: core.hpp:385
UVMap::FlipAxis axis_
Definition: core.hpp:387
Return the inverted transform.
Definition: core.hpp:845
Transform3D::Pointer input_
Definition: core.hpp:848
void deserialize_(const smgl::Metadata &meta, const filesystem::path &cacheDir) override
smgl::InputPort< Transform3D::Pointer > input
Input transform.
Definition: core.hpp:854
auto serialize_(bool useCache, const filesystem::path &cacheDir) -> smgl::Metadata override
Transform3D::Pointer output_
Definition: core.hpp:850
smgl::OutputPort< Transform3D::Pointer > output
Output transform.
Definition: core.hpp:856
Read an image from the specified path.
Definition: core.hpp:501
smgl::InputPort< bool > cacheArgs
Include the loaded file in the graph cache.
Definition: core.hpp:514
smgl::InputPort< filesystem::path > path
Input path.
Definition: core.hpp:512
smgl::OutputPort< cv::Mat > image
Loaded image.
Definition: core.hpp:516
void deserialize_(const smgl::Metadata &meta, const filesystem::path &) override
auto serialize_(bool useCache, const filesystem::path &cacheDir) -> smgl::Metadata override
filesystem::path path_
Definition: core.hpp:504
Read a mesh from a file.
Definition: core.hpp:253
auto serialize_(bool useCache, const filesystem::path &cacheDir) -> smgl::Metadata override
smgl::OutputPort< cv::Mat > texture
Loaded texture image.
Definition: core.hpp:272
MeshReaderResult loaded_
Definition: core.hpp:260
filesystem::path path_
Definition: core.hpp:256
void deserialize_(const smgl::Metadata &meta, const filesystem::path &) override
smgl::InputPort< bool > cacheArgs
Include the loaded file in the graph cache.
Definition: core.hpp:266
smgl::OutputPort< ITKMesh::Pointer > mesh
Loaded mesh.
Definition: core.hpp:268
smgl::OutputPort< UVMap::Pointer > uvMap
Loaded UV map.
Definition: core.hpp:270
smgl::InputPort< filesystem::path > path
Input path.
Definition: core.hpp:264
Read a PerPixelMap from disk.
Definition: core.hpp:625
auto serialize_(bool useCache, const filesystem::path &cacheDir) -> smgl::Metadata override
smgl::OutputPort< PerPixelMap::Pointer > ppm
Loaded PerPixelMap.
Definition: core.hpp:640
smgl::InputPort< filesystem::path > path
Input path.
Definition: core.hpp:636
smgl::InputPort< bool > cacheArgs
Include the loaded file in the graph cache.
Definition: core.hpp:638
PerPixelMap::Pointer ppm_
Definition: core.hpp:632
filesystem::path path_
Definition: core.hpp:628
void deserialize_(const smgl::Metadata &meta, const filesystem::path &) override
Load a transform from a JSON file.
Definition: core.hpp:766
Transform3D::Pointer tfm_
Definition: core.hpp:773
void deserialize_(const smgl::Metadata &meta, const filesystem::path &) override
auto serialize_(bool useCache, const filesystem::path &cacheDir) -> smgl::Metadata override
smgl::OutputPort< Transform3D::Pointer > transform
Loaded transform.
Definition: core.hpp:781
filesystem::path path_
Definition: core.hpp:769
smgl::InputPort< bool > cacheArgs
Include the loaded file in the graph cache.
Definition: core.hpp:779
smgl::InputPort< filesystem::path > path
Input path.
Definition: core.hpp:777
Load a VolumePkg from disk.
Definition: core.hpp:31
auto serialize_(bool, const filesystem::path &) -> smgl::Metadata override
smgl::OutputPort< VolumePkg::Pointer > volpkg
Loaded VolPkg.
Definition: core.hpp:42
VolumePkg::Pointer vpkg_
Definition: core.hpp:36
filesystem::path path_
Definition: core.hpp:34
void deserialize_(const smgl::Metadata &meta, const filesystem::path &) override
smgl::InputPort< filesystem::path > path
VolPkg path.
Definition: core.hpp:40
Load a VolumetricMask from a .vcps file.
Definition: core.hpp:728
smgl::InputPort< bool > cacheArgs
Include the loaded file in the graph cache.
Definition: core.hpp:741
void deserialize_(const smgl::Metadata &meta, const filesystem::path &) override
VolumetricMask::Pointer mask_
Definition: core.hpp:735
auto serialize_(bool useCache, const filesystem::path &cacheDir) -> smgl::Metadata override
smgl::OutputPort< VolumetricMask::Pointer > volumetricMask
Loaded VolumetricMask.
Definition: core.hpp:743
filesystem::path path_
Definition: core.hpp:731
smgl::InputPort< filesystem::path > path
Input path.
Definition: core.hpp:739
Retrieve Mesh properties (e.g. number of vertices, number of faces, etc.)
Definition: core.hpp:229
smgl::OutputPort< std::size_t > numVertices
Number of vertices in the mesh.
Definition: core.hpp:238
smgl::InputPort< ITKMesh::Pointer > mesh
Input mesh.
Definition: core.hpp:236
smgl::OutputPort< std::size_t > numFaces
Number of faces in the mesh.
Definition: core.hpp:240
ITKMesh::Pointer mesh_
Definition: core.hpp:232
Retrieve PerPixelMap properties (e.g. mask, cell map, etc.)
Definition: core.hpp:699
smgl::OutputPort< cv::Mat > mask
Get the pixel mask.
Definition: core.hpp:712
PerPixelMap::Pointer ppm_
Definition: core.hpp:702
smgl::OutputPort< cv::Mat > cellMap
Get the cell map image.
Definition: core.hpp:714
smgl::InputPort< PerPixelMap::Pointer > ppm
Input PerPixelMap.
Definition: core.hpp:706
std::shared_ptr< PerPixelMap > Pointer
Definition: PerPixelMap.hpp:84
Plot the UV points on an image.
Definition: core.hpp:464
auto serialize_(bool useCache, const filesystem::path &cacheDir) -> smgl::Metadata override
smgl::InputPort< UVMap::Pointer > uvMap
Input UVMap.
Definition: core.hpp:475
UVMap::Pointer uvMap_
Definition: core.hpp:467
smgl::OutputPort< cv::Mat > plot
Plot image.
Definition: core.hpp:479
smgl::InputPort< ITKMesh::Pointer > uvMesh
Input mesh.
Definition: core.hpp:477
void deserialize_(const smgl::Metadata &meta, const filesystem::path &cacheDir) override
ITKMesh::Pointer uvMesh_
Definition: core.hpp:469
Rotate a UVMap by a multiple of 90 degrees.
Definition: core.hpp:344
smgl::InputPort< UVMap::Pointer > uvMapIn
Input UVMap.
Definition: core.hpp:355
smgl::OutputPort< UVMap::Pointer > uvMapOut
Output UVMap.
Definition: core.hpp:359
smgl::InputPort< double > theta
Rotation angle, in degrees.
Definition: core.hpp:357
void deserialize_(const smgl::Metadata &meta, const filesystem::path &cacheDir) override
UVMap::Pointer uvMapIn_
Definition: core.hpp:347
UVMap::Pointer uvMapOut_
Definition: core.hpp:351
auto serialize_(bool useCache, const filesystem::path &cacheDir) -> smgl::Metadata override
Retrieve Segmentation properties (e.g. pointset)
Definition: core.hpp:208
smgl::OutputPort< Segmentation::PointSet > pointSet
Load the associated PointSet from the Segmentation file.
Definition: core.hpp:216
smgl::InputPort< Segmentation::Pointer > segmentation
Input segmentation.
Definition: core.hpp:214
Segmentation::Pointer seg_
Definition: core.hpp:210
Get a Segmentation by uuid.
Definition: core.hpp:171
smgl::InputPort< Segmentation::Identifier > id
Segmentation UUID.
Definition: core.hpp:184
VolumePkg::Pointer vpkg_
Definition: core.hpp:174
Segmentation::Pointer seg_
Definition: core.hpp:178
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.
Definition: core.hpp:182
smgl::OutputPort< Segmentation::Pointer > segmentation
Segmentation.
Definition: core.hpp:186
Segmentation::Identifier id_
Definition: core.hpp:176
std::shared_ptr< Segmentation > Pointer
std::shared_ptr< Transform3D > Pointer
Definition: Transforms.hpp:56
static void Save(const filesystem::path &path, const Pointer &transform)
Save a transform to a JSON file.
std::string Identifier
Definition: Transforms.hpp:59
static auto Load(const filesystem::path &path) -> Pointer
Load a transform from a JSON file.
Apply a transform to an ITKMesh.
Definition: core.hpp:938
auto serialize_(bool useCache, const filesystem::path &cacheDir) -> smgl::Metadata override
void deserialize_(const smgl::Metadata &meta, const filesystem::path &cacheDir) override
Apply a transform to a PerPixelMap.
Definition: core.hpp:958
void deserialize_(const smgl::Metadata &meta, const filesystem::path &cacheDir) override
auto serialize_(bool useCache, const filesystem::path &cacheDir) -> smgl::Metadata override
Get a transform by ID.
Definition: core.hpp:805
VolumePkg::Pointer vpkg_
Definition: core.hpp:808
auto serialize_(bool, const filesystem::path &) -> smgl::Metadata override
smgl::InputPort< Transform3D::Identifier > id
Transform ID.
Definition: core.hpp:818
smgl::InputPort< VolumePkg::Pointer > volpkg
Input VolumePkg.
Definition: core.hpp:816
smgl::OutputPort< Transform3D::Pointer > transform
Transform.
Definition: core.hpp:820
Transform3D::Pointer tfm_
Definition: core.hpp:812
void deserialize_(const smgl::Metadata &meta, const filesystem::path &) override
Transform3D::Identifier id_
Definition: core.hpp:810
std::shared_ptr< UVMap > Pointer
Definition: UVMap.hpp:55
Retrieve VolumePkg properties (e.g. name, version, etc.)
Definition: core.hpp:64
smgl::InputPort< VolumePkg::Pointer > volpkg
Input VolumePkg.
Definition: core.hpp:71
VolumePkg::Pointer vpkg_
Definition: core.hpp:67
smgl::OutputPort< std::string > name
Returns the identifying name of the VolumePkg.
Definition: core.hpp:73
smgl::OutputPort< int > version
Returns the VolumePkg version.
Definition: core.hpp:75
smgl::OutputPort< double > materialThickness
Returns the approx. thickness of a material layer in microns (um).
Definition: core.hpp:77
std::shared_ptr< VolumePkg > Pointer
Definition: VolumePkg.hpp:61
Set/Retrieve Volume properties (voxel size, bounds, etc.)
Definition: core.hpp:126
smgl::InputPort< std::size_t > cacheMemory
Set the maximum size of the cache in bytes.
Definition: core.hpp:137
void deserialize_(const smgl::Metadata &meta, const filesystem::path &) override
smgl::OutputPort< Volume::Pointer > volumeOut
Output Volume.
Definition: core.hpp:149
smgl::InputPort< Volume::Pointer > volumeIn
Input Volume.
Definition: core.hpp:135
auto serialize_(bool, const filesystem::path &) -> smgl::Metadata override
Volume::Pointer volume_
Definition: core.hpp:129
smgl::OutputPort< double > voxelSize
Get the voxel size (in microns)
Definition: core.hpp:142
smgl::OutputPort< Volume::Bounds > bounds
Get the bounding box.
Definition: core.hpp:140
Get a Volume by uuid.
Definition: core.hpp:89
smgl::InputPort< Volume::Identifier > id
Volume UUID.
Definition: core.hpp:102
Volume::Pointer vol_
Definition: core.hpp:96
smgl::InputPort< VolumePkg::Pointer > volpkg
Input VolumePkg.
Definition: core.hpp:100
auto serialize_(bool, const filesystem::path &) -> smgl::Metadata override
Volume::Identifier id_
Definition: core.hpp:94
VolumePkg::Pointer vpkg_
Definition: core.hpp:92
smgl::OutputPort< Volume::Pointer > volume
Volume.
Definition: core.hpp:104
void deserialize_(const smgl::Metadata &meta, const filesystem::path &) override
std::shared_ptr< Volume > Pointer
Definition: Volume.hpp:42
std::shared_ptr< VolumetricMask > Pointer
Write image to the specified path.
Definition: core.hpp:539
smgl::InputPort< bool > cacheArgs
Include the saved file in the graph cache.
Definition: core.hpp:558
filesystem::path path_
Definition: core.hpp:542
auto serialize_(bool useCache, const filesystem::path &cacheDir) -> smgl::Metadata override
smgl::InputPort< cv::Mat > image
Output image.
Definition: core.hpp:554
smgl::InputPort< WriteImageOpts > options
Image writer options.
Definition: core.hpp:556
smgl::InputPort< filesystem::path > path
Output file.
Definition: core.hpp:552
WriteImageOpts opts_
Definition: core.hpp:546
void deserialize_(const smgl::Metadata &meta, const filesystem::path &) override
smgl::InputPort< bool > cacheArgs
Include the saved file in the graph cache.
Definition: core.hpp:602
std::vector< cv::Mat > ImageSequence
Definition: core.hpp:584
smgl::InputPort< filesystem::path > path
Output file.
Definition: core.hpp:596
void deserialize_(const smgl::Metadata &meta, const filesystem::path &) override
smgl::InputPort< WriteImageOpts > options
Image writer options.
Definition: core.hpp:600
filesystem::path path_
Definition: core.hpp:586
smgl::InputPort< ImageSequence > images
Output image sequence.
Definition: core.hpp:598
auto serialize_(bool useCache, const filesystem::path &cacheDir) -> smgl::Metadata override
Write a mesh to a file.
Definition: core.hpp:295
void deserialize_(const smgl::Metadata &meta, const filesystem::path &) override
smgl::InputPort< bool > cacheArgs
Include the saved file in the graph cache.
Definition: core.hpp:318
filesystem::path path_
Definition: core.hpp:298
smgl::InputPort< filesystem::path > path
Output file.
Definition: core.hpp:310
ITKMesh::Pointer mesh_
Definition: core.hpp:300
smgl::InputPort< cv::Mat > texture
Texture image.
Definition: core.hpp:316
UVMap::Pointer uv_
Definition: core.hpp:302
auto serialize_(bool useCache, const filesystem::path &cacheDir) -> smgl::Metadata override
smgl::InputPort< UVMap::Pointer > uvMap
UV map.
Definition: core.hpp:314
smgl::InputPort< ITKMesh::Pointer > mesh
Mesh.
Definition: core.hpp:312
Write a PerPixelMap to disk.
Definition: core.hpp:663
void deserialize_(const smgl::Metadata &meta, const filesystem::path &) override
smgl::InputPort< PerPixelMap::Pointer > ppm
Output PerPixelMap.
Definition: core.hpp:676
filesystem::path path_
Definition: core.hpp:666
smgl::InputPort< filesystem::path > path
Output file.
Definition: core.hpp:674
PerPixelMap::Pointer ppm_
Definition: core.hpp:668
auto serialize_(bool useCache, const filesystem::path &cacheDir) -> smgl::Metadata override
smgl::InputPort< bool > cacheArgs
Include the saved file in the graph cache.
Definition: core.hpp:678
Volume Cartographer library
auto ApplyTransform(const ITKMesh::Pointer &mesh, const Transform3D::Pointer &transform, bool normalize=true) -> ITKMesh::Pointer
Apply a transform to an ITKMesh.
Result for ReadMesh.
Definition: MeshIO.hpp:16