DGtal 2.1.0
Loading...
Searching...
No Matches
viewer3D-8bis-2Dimages.cpp File Reference
#include "DGtal/base/Common.h"
#include "DGtal/io/readers/VolReader.h"
#include "DGtal/images/ImageHelper.h"
#include "ConfigExamples.h"
#include "DGtal/io/viewers/PolyscopeViewer.h"
#include "DGtal/kernel/BasicPointFunctors.h"
Include dependency graph for viewer3D-8bis-2Dimages.cpp:

Go to the source code of this file.

Functions

int main ()
 

Detailed Description

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Author
Bertrand Kerautret (kerau.nosp@m.tre@.nosp@m.loria.nosp@m..fr ) LORIA (CNRS, UMR 7503), University of Nancy, France
Date
2013/11/18

An example file named viewer3D-8bis-2Dimages.

This file is part of the DGtal library.

Definition in file viewer3D-8bis-2Dimages.cpp.

Function Documentation

◆ main()

int main ( void  )

[ExampleViewer3D2DImagesExtractImagesNonSliceType]

[ExampleViewer3D2DImagesExtractImagesNonSliceType]

[ExampleViewer3D2DImagesExtractImagesNonSliceParam]

[ExampleViewer3D2DImagesExtractImagesNonSliceParam]

[ExampleViewer3D2DImagesExtractImagesNonSliceExtract]

[ExampleViewer3D2DImagesExtractImagesNonSliceExtract]

[ExampleViewer3D2DImagesExtractImagesNonSliceDisplay]

[ExampleViewer3D2DImagesExtractImagesNonSliceDisplay]

Definition at line 55 of file viewer3D-8bis-2Dimages.cpp.

56{
57
61 Image3D::Value, DGtal::functors::Identity > ImageAdapterExtractor;
62
64 polyscope::options::programName = "examples/io/viewers: viewer3D-8bis-2Dimages";
65 PolyscopeViewer viewer;
66
67
68
69 std::string inputFilename = examplesPath + "samples/lobster.vol";
70 Image3D imageVol = VolReader<Image3D>::importVol(inputFilename);
72
73
74
76 DGtal::Z3i::Point ptCenter(50, 62, 28);
77 const int IMAGE_PATCH_WIDTH = 30;
78 // Setting the image domain of the resulting image to be displayed in 3D:
79 DGtal::Z2i::Domain domainImage2D (DGtal::Z2i::Point(0,0),
82
83
84
85 unsigned int pos=0;
86 for (double alpha = 0; alpha< 1.54; alpha+= 0.01){
88 // Extracting images from 3D embeder
90 ptCenter+DGtal::Z3i::Point(static_cast<int>(200.0*cos(alpha)),
91 static_cast<int>(100.0*sin(alpha))),
92 DGtal::Z3i::RealPoint(cos(alpha),sin(alpha),cos(2.0*alpha)),
94 ImageAdapterExtractor extractedImage(imageVol, domainImage2D, embedder, idV);
96
98 //Display image and update its position
99 viewer << extractedImage;
101 pos++;
102 }
103
104
105
106 viewer.show();
107 return EXIT_SUCCESS;
108
109}
Aim: implements a const image adapter with a given domain (i.e. a subdomain) and 2 functors : g for d...
void show() override
Starts the event loop and display of elements.
Aim: Functor that embeds a 2D point into a 3D space from two axis vectors and an origin point given i...
const int IMAGE_PATCH_WIDTH
static ImageContainer importVol(const std::string &filename, const Functor &aFunctor=Functor())
Aim: Define a simple default functor that just returns its argument.

References IMAGE_PATCH_WIDTH, DGtal::VolReader< TImageContainer, TFunctor >::importVol(), and DGtal::PolyscopeViewer< Space, KSpace >::show().