Skip to content

Commit d44836d

Browse files
committed
Reset to last feature
1 parent 527ef53 commit d44836d

File tree

6 files changed

+19
-8
lines changed

6 files changed

+19
-8
lines changed

.gitconfig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
# Generated by nbdev_install_hooks
2+
#
3+
# If you need to disable this instrumentation do:
4+
# git config --local --unset include.path
5+
#
6+
# To restore:
7+
# git config --local include.path ../.gitconfig
8+
#
19
[merge "nbdev-merge"]
210
name = resolve conflicts with nbdev_fix
311
driver = nbdev_merge %O %A %B %P

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,4 +98,4 @@ target/
9898
.mypy_cache/
9999

100100
# Jupyter notebooks
101-
.last_checked
101+
**/.last_checked

diffdrr/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.4.3"
1+
__version__ = "0.4.2"

diffdrr/visualization.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ def drr_to_mesh(
181181
subject: Subject, # torchio.Subject with a `volume` attribute
182182
method: str, # Either `surface_nets` or `marching_cubes`
183183
threshold: float = 150, # Min value for marching cubes (Hounsfield units)
184+
extract_largest: bool = True, # Extract the largest connected component from the mesh
184185
verbose: bool = True, # Display progress bars for mesh processing steps
185186
):
186187
"""
@@ -190,7 +191,7 @@ def drr_to_mesh(
190191
191192
The mesh processing steps are:
192193
193-
1. Keep only largest connected components
194+
1. Keep only largest connected components (optional)
194195
2. Smooth
195196
3. Decimate (if `method=="marching_cubes"`)
196197
4. Fill any holes
@@ -229,7 +230,8 @@ def drr_to_mesh(
229230
mesh = mesh.transform(subject.volume.affine.squeeze())
230231

231232
# Preprocess the mesh
232-
mesh.extract_largest(inplace=True, progress_bar=verbose)
233+
if extract_largest:
234+
mesh.extract_largest(inplace=True, progress_bar=verbose)
233235
mesh.point_data.clear()
234236
mesh.cell_data.clear()
235237
mesh.smooth_taubin(

notebooks/api/04_visualization.ipynb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,7 @@
286286
" subject: Subject, # torchio.Subject with a `volume` attribute\n",
287287
" method: str, # Either `surface_nets` or `marching_cubes`\n",
288288
" threshold: float = 150, # Min value for marching cubes (Hounsfield units)\n",
289+
" extract_largest: bool = True, # Extract the largest connected component from the mesh\n",
289290
" verbose: bool = True, # Display progress bars for mesh processing steps\n",
290291
"):\n",
291292
" \"\"\"\n",
@@ -295,7 +296,7 @@
295296
"\n",
296297
" The mesh processing steps are:\n",
297298
"\n",
298-
" 1. Keep only largest connected components\n",
299+
" 1. Keep only largest connected components (optional)\n",
299300
" 2. Smooth\n",
300301
" 3. Decimate (if `method==\"marching_cubes\"`)\n",
301302
" 4. Fill any holes\n",
@@ -334,7 +335,8 @@
334335
" mesh = mesh.transform(subject.volume.affine.squeeze())\n",
335336
"\n",
336337
" # Preprocess the mesh\n",
337-
" mesh.extract_largest(inplace=True, progress_bar=verbose)\n",
338+
" if extract_largest:\n",
339+
" mesh.extract_largest(inplace=True, progress_bar=verbose)\n",
338340
" mesh.point_data.clear()\n",
339341
" mesh.cell_data.clear()\n",
340342
" mesh.smooth_taubin(\n",

settings.ini

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[DEFAULT]
22
repo = DiffDRR
33
lib_name = diffdrr
4-
version = 0.4.3
4+
version = 0.4.2
55
min_python = 3.8
66
license = mit
77
black_formatting = True
@@ -36,4 +36,3 @@ allowed_cell_metadata_keys =
3636
jupyter_hooks = True
3737
clean_ids = True
3838
clear_all = False
39-

0 commit comments

Comments
 (0)