File tree 3 files changed +12
-1
lines changed 3 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -65,6 +65,7 @@ In **dcm2save.py** are 3 special configuration variables:
65
65
minVal = 130
66
66
maxVal = 134
67
67
materialSwitch = 15
68
+ maxVoxels = -1
68
69
69
70
** minVal** and ** maxVal** are the raw gray values from the image, every value in between would be displayed later.
70
71
You ** HAVE** to play with those values to get an accurate result (later there will be a GUI for that....).
@@ -73,7 +74,10 @@ You **HAVE** to play with those values to get an accurate result (later there wi
73
74
You may have to play with it too.
74
75
The maximum value is 99.
75
76
76
- All 3 have command line switches too.
77
+ ** maxVoxels** is the maximum number of voxels to be processed.
78
+ If you have a large dataset, you can limit the number of voxels to be processed.
79
+
80
+ All have command line switches too.
77
81
78
82
``` bash
79
83
python dcm2save.py tmp/ savefile=bison_brain.sav minVal=10 maxVal=255 materialSwitch=10
Original file line number Diff line number Diff line change 10
10
minVal = 130 #12850
11
11
maxVal = 136 #13000 #13366
12
12
materialSwitch = 15
13
+ maxVoxels = - 1
13
14
14
15
# max len of material index we can use
15
16
materialMatrixL = 99 #len(materialMatrix)
@@ -62,6 +63,8 @@ def getInt(name):
62
63
materialSwitch = int (arg .replace ("materialSwitch=" , "" ))
63
64
elif arg .startswith ("heightMap=" ):
64
65
heightMap = bool (int (arg .replace ("heightMap=" , "" )))
66
+ elif arg .startswith ("maxVoxels=" ):
67
+ maxVoxels = int (arg .replace ("maxVoxels=" , "" ))
65
68
66
69
if heightMap :
67
70
sourceFiles .append (sys .argv [1 ])
@@ -376,6 +379,8 @@ def getFromPnm():
376
379
countX += 1
377
380
countZ += 1
378
381
print ("current voxel:" , countVoxel )
382
+ if maxVoxels != - 1 and countVoxel >= maxVoxels :
383
+ break
379
384
#if countZ > 10:
380
385
# break
381
386
#finalStr += "\n"
Original file line number Diff line number Diff line change @@ -184,9 +184,11 @@ def _initialize(self):
184
184
185
185
def force_show (self ):
186
186
# dirty hack to force rendering
187
+ counter = 0
187
188
for position , data in self .world .items ():
188
189
if self .exposed (position ):
189
190
self ._show_block (position , data )
191
+ counter += 1
190
192
191
193
def hit_test (self , position , vector , max_distance = 8 ):
192
194
""" Line of sight search from current position. If a block is
You can’t perform that action at this time.
0 commit comments