You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: converters/vol2heightfield.cpp
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -58,13 +58,13 @@ using namespace DGtal;
58
58
@code
59
59
60
60
Positionals:
61
-
1 TEXT:FILE REQUIRED vol file (.vol, .longvol .p3d, .pgm3d and if WITH_ITK is selected: dicom, dcm, mha, mhd). For longvol, dicom, dcm, mha or mhd formats, the input values are linearly scaled between 0 and 255.
61
+
1 TEXT:FILE REQUIRED vol file (.vol, .longvol .p3d, .pgm3d and if DGTAL_WITH_ITK is selected: dicom, dcm, mha, mhd). For longvol, dicom, dcm, mha or mhd formats, the input values are linearly scaled between 0 and 255.
62
62
2 TEXT=result.pgm resulting image filename (in pgm or other).
63
63
64
64
65
65
Options:
66
66
-h,--help Print this help message and exit
67
-
-i,--input TEXT:FILE REQUIRED vol file (.vol, .longvol .p3d, .pgm3d and if WITH_ITK is selected: dicom, dcm, mha, mhd). For longvol, dicom, dcm, mha or mhd formats, the input values are linearly scaled between 0 and 255.
67
+
-i,--input TEXT:FILE REQUIRED vol file (.vol, .longvol .p3d, .pgm3d and if DGTAL_WITH_ITK is selected: dicom, dcm, mha, mhd). For longvol, dicom, dcm, mha or mhd formats, the input values are linearly scaled between 0 and 255.
68
68
-o,--output TEXT resulting image filename (in pgm or other)
69
69
-m,--thresholdMin INT=128 threshold min (excluded) to define binary shape.
70
70
-M,--thresholdMax INT=255 threshold max (included) to define binary shape.
@@ -124,7 +124,7 @@ int main( int argc, char** argv )
124
124
bool bgLastDepth = false;
125
125
126
126
app.description("Convert volumetric file into a projected 2D image given from a normal direction N and from a starting point P. The 3D volume is scanned in this normal direction N starting from P with a step 1. If the intensity of the 3d point is inside the given thresholds its 2D gray values are set to the current scan number.\n Example:\n vol2heightfield -i ${DGtal}/examples/samples/lobster.vol -m 60 -M 500 --nx 0 --ny 0.7 --nz -1 -x 150 -y 0 -z 150 --width 300 --height 300 --heightFieldMaxScan 350 -o resultingHeightMap.pgm");
127
-
app.add_option("-i,--input,1", inputFileName, "vol file (.vol, .longvol .p3d, .pgm3d and if WITH_ITK is selected: dicom, dcm, mha, mhd). For longvol, dicom, dcm, mha or mhd formats, the input values are linearly scaled between 0 and 255." )
127
+
app.add_option("-i,--input,1", inputFileName, "vol file (.vol, .longvol .p3d, .pgm3d and if DGTAL_WITH_ITK is selected: dicom, dcm, mha, mhd). For longvol, dicom, dcm, mha or mhd formats, the input values are linearly scaled between 0 and 255." )
128
128
->required()
129
129
->check(CLI::ExistingFile);
130
130
app.add_option("-o,--output,2", outputFileName, "resulting image filename (in pgm or other).");
Copy file name to clipboardExpand all lines: converters/vol2obj.cpp
+64-11Lines changed: 64 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -29,8 +29,6 @@
29
29
#include"DGtal/base/Common.h"
30
30
#include"DGtal/helpers/StdDefs.h"
31
31
#include"DGtal/io/readers/GenericReader.h"
32
-
#include"DGtal/io/boards/Board3D.h"
33
-
#include"DGtal/io/DrawWithDisplay3DModifier.h"
34
32
#include"DGtal/io/readers/PointListReader.h"
35
33
36
34
#include"DGtal/images/ImageSelector.h"
@@ -56,12 +54,12 @@ between
56
54
@code
57
55
58
56
Positionals:
59
-
1 TEXT:FILE REQUIRED vol file (.vol, .longvol .p3d, .pgm3d or .sdp and if WITH_ITK is selected: dicom, dcm, mha, mhd). For longvol, dicom, dcm, mha or mhd formats, the input values are linearly scaled between 0 and 255.
57
+
1 TEXT:FILE REQUIRED vol file (.vol, .longvol .p3d, .pgm3d or .sdp and if DGTAL_WITH_ITK is selected: dicom, dcm, mha, mhd). For longvol, dicom, dcm, mha or mhd formats, the input values are linearly scaled between 0 and 255.
60
58
2 TEXT output file (.obj or .off).
61
59
62
60
Options:
63
61
-h,--help Print this help message and exit
64
-
-i,--input TEXT:FILE REQUIRED vol file (.vol, .longvol .p3d, .pgm3d or .sdp and if WITH_ITK is selected: dicom, dcm, mha, mhd). For longvol, dicom, dcm, mha or mhd formats, the input values are linearly scaled between 0 and 255.
62
+
-i,--input TEXT:FILE REQUIRED vol file (.vol, .longvol .p3d, .pgm3d or .sdp and if DGTAL_WITH_ITK is selected: dicom, dcm, mha, mhd). For longvol, dicom, dcm, mha or mhd formats, the input values are linearly scaled between 0 and 255.
65
63
-o,--output TEXT output file (.obj or .off).
66
64
-m,--thresholdMin INT=128 threshold min (excluded) to define binary shape.
67
65
-M,--thresholdMax INT=255 threshold max (included) to define binary shape.
constexprstatic std::array<std::array<size_t, 3>, 12> indices {{
94
+
{0, 1, 3}, {1, 2, 3},
95
+
{0, 1, 4}, {1, 5, 4},
96
+
{1, 2, 5}, {2, 6, 5},
97
+
{3, 7, 2}, {7, 6, 2},
98
+
{4, 5, 7}, {5, 6, 7},
99
+
{0, 4, 3}, {4, 7, 3}
100
+
}};
101
+
102
+
constdouble x = center[0];
103
+
constdouble y = center[1];
104
+
constdouble z = center[2];
105
+
106
+
constsize_t startIndex = vertices.size() + 1;
107
+
for (size_t i = 0; i < coords.size(); ++i) {
108
+
vertices.push_back({x + coords[i][0],
109
+
y + coords[i][1],
110
+
z + coords[i][2]});
111
+
}
112
+
for (size_t i = 0; i < indices.size(); ++i) {
113
+
faces.push_back({startIndex + indices[i][0],
114
+
startIndex + indices[i][1],
115
+
startIndex + indices[i][2]});
116
+
}
117
+
}
79
118
80
119
intmain( int argc, char** argv )
81
120
{
@@ -91,7 +130,7 @@ int main( int argc, char** argv )
91
130
92
131
93
132
app.description(" Converts any volumetric file (or .sdp file) to an OBJ one. Each grid point with value between [thresholdMin, thresholdMax] is exported as a unit cube.");
94
-
app.add_option("-i,--input,1", inputFileName, "vol file (.vol, .longvol .p3d, .pgm3d or .sdp and if WITH_ITK is selected: dicom, dcm, mha, mhd). For longvol, dicom, dcm, mha or mhd formats, the input values are linearly scaled between 0 and 255." )
133
+
app.add_option("-i,--input,1", inputFileName, "vol file (.vol, .longvol .p3d, .pgm3d or .sdp and if DGTAL_WITH_ITK is selected: dicom, dcm, mha, mhd). For longvol, dicom, dcm, mha or mhd formats, the input values are linearly scaled between 0 and 255." )
95
134
->required()
96
135
->check(CLI::ExistingFile);
97
136
app.add_option("--output,-o,2",outputFileName ,"output file (.obj or .off).");
@@ -104,9 +143,9 @@ int main( int argc, char** argv )
104
143
app.get_formatter()->column_width(40);
105
144
CLI11_PARSE(app, argc, argv);
106
145
// END parse command line using CLI ----------------------------------------------
Copy file name to clipboardExpand all lines: converters/vol2raw.cpp
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -54,12 +54,12 @@ using namespace Z3i;
54
54
Usage: ./converters/vol2raw [OPTIONS] 1 [2]
55
55
56
56
Positionals:
57
-
1 TEXT:FILE REQUIRED vol file (.vol, .longvol .p3d, .pgm3d and if WITH_ITK is selected: dicom, dcm, mha, mhd). For longvol, dicom, dcm, mha or mhd formats, the input values are linearly scaled between 0 and 255.
57
+
1 TEXT:FILE REQUIRED vol file (.vol, .longvol .p3d, .pgm3d and if DGTAL_WITH_ITK is selected: dicom, dcm, mha, mhd). For longvol, dicom, dcm, mha or mhd formats, the input values are linearly scaled between 0 and 255.
58
58
2 TEXT output file (.raw).
59
59
60
60
Options:
61
61
-h,--help Print this help message and exit
62
-
-i,--input TEXT:FILE REQUIRED vol file (.vol, .longvol .p3d, .pgm3d and if WITH_ITK is selected: dicom, dcm, mha, mhd). For longvol, dicom, dcm, mha or mhd formats, the input values are linearly scaled between 0 and 255.
62
+
-i,--input TEXT:FILE REQUIRED vol file (.vol, .longvol .p3d, .pgm3d and if DGTAL_WITH_ITK is selected: dicom, dcm, mha, mhd). For longvol, dicom, dcm, mha or mhd formats, the input values are linearly scaled between 0 and 255.
63
63
-o,--output TEXT output file (.raw).
64
64
--rescaleInputMin INT=0 min value used to rescale the input intensity (to avoid basic cast into 8 bits image).
65
65
--rescaleInputMax INT=255 max value used to rescale the input intensity (to avoid basic cast into 8 bits image).
@@ -101,7 +101,7 @@ int main(int argc, char**argv)
101
101
DGtal::int64_t rescaleInputMax {255};
102
102
103
103
app.description("Convert a vol to a 8-bit raw file.\n Example: vol2raw ${DGtal}/examples/samples/lobster.vol res.raw \n");
104
-
app.add_option("-i,--input,1", inputFileName, "vol file (.vol, .longvol .p3d, .pgm3d and if WITH_ITK is selected: dicom, dcm, mha, mhd). For longvol, dicom, dcm, mha or mhd formats, the input values are linearly scaled between 0 and 255." )
104
+
app.add_option("-i,--input,1", inputFileName, "vol file (.vol, .longvol .p3d, .pgm3d and if DGTAL_WITH_ITK is selected: dicom, dcm, mha, mhd). For longvol, dicom, dcm, mha or mhd formats, the input values are linearly scaled between 0 and 255." )
Copy file name to clipboardExpand all lines: converters/vol2sdp.cpp
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -56,13 +56,13 @@ using namespace DGtal;
56
56
Usage: ./converters/vol2sdp [OPTIONS] 1 [2]
57
57
58
58
Positionals:
59
-
1 TEXT:FILE REQUIRED vol file (.vol, .longvol .p3d, .pgm3d and if WITH_ITK is selected: dicom, dcm, mha, mhd) or sdp (sequence of discrete points). For longvol, dicom, dcm, mha or mhd formats, the input values are linearly scaled between 0 and 255.
59
+
1 TEXT:FILE REQUIRED vol file (.vol, .longvol .p3d, .pgm3d and if DGTAL_WITH_ITK is selected: dicom, dcm, mha, mhd) or sdp (sequence of discrete points). For longvol, dicom, dcm, mha or mhd formats, the input values are linearly scaled between 0 and 255.
60
60
2 TEXT=result.sdp sequence of discrete point file (.sdp)
61
61
62
62
Options:
63
63
-h,--help Print this help message and exit
64
64
-i,--input TEXT:FILE REQUIRED
65
-
vol file (.vol, .longvol .p3d, .pgm3d and if WITH_ITK is selected: dicom, dcm, mha, mhd) or sdp (sequence of discrete points).
65
+
vol file (.vol, .longvol .p3d, .pgm3d and if DGTAL_WITH_ITK is selected: dicom, dcm, mha, mhd) or sdp (sequence of discrete points).
66
66
For longvol, dicom, dcm, mha or mhd formats, the input values are linearly scaled between 0 and 255.
67
67
-o,--output TEXT=result.sdp sequence of discrete point file (.sdp)
68
68
-e,--exportImageValues option to export also the image value of the voxel in a fourth field.
@@ -102,7 +102,7 @@ int main( int argc, char** argv )
102
102
103
103
// parse command line using CLI ----------------------------------------------
104
104
app.description("Convert volumetric file into a digital set of points from a given threshold.\n vol2sdp -i ${DGtal}/examples/samples/lobster.vol -o volumeList.sdp");
105
-
app.add_option("-i,--input,1", inputFilename, "vol file (.vol, .longvol .p3d, .pgm3d and if WITH_ITK is selected: dicom, dcm, mha, mhd) or sdp (sequence of discrete points). For longvol, dicom, dcm, mha or mhd formats, the input values are linearly scaled between 0 and 255." )
105
+
app.add_option("-i,--input,1", inputFilename, "vol file (.vol, .longvol .p3d, .pgm3d and if DGTAL_WITH_ITK is selected: dicom, dcm, mha, mhd) or sdp (sequence of discrete points). For longvol, dicom, dcm, mha or mhd formats, the input values are linearly scaled between 0 and 255." )
106
106
->required()
107
107
->check(CLI::ExistingFile);
108
108
app.add_option("--output,-o,2", outputFilename, "sequence of discrete point file (.sdp)", true);
0 commit comments