Skip to content

Commit 6ee68ad

Browse files
authored
refactor: Remove '4d' naming convention across codebase (#22)
Remove '4d' suffix from module names, function names, and references throughout the codebase. Update documentation, examples, and notebooks to reflect simplified naming convention. The temporal dimension is implicit in the physiomotion4d package name, and most methods work on 3D as well as 4D data.
1 parent de0c4cf commit 6ee68ad

45 files changed

Lines changed: 822 additions & 2896 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ jobs:
221221

222222
- name: Run USD conversion tests
223223
run: |
224-
pytest tests/test_convert_vtk_4d_to_usd_polymesh.py -v -m "not slow" --cov=physiomotion4d --cov-append --cov-report=xml
224+
pytest tests/test_convert_vtk_to_usd_polymesh.py -v -m "not slow" --cov=physiomotion4d --cov-append --cov-report=xml
225225
continue-on-error: true
226226

227227
- name: Run USD utility tests

docs/api/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ By Category
100100
**USD Tools**
101101
* :mod:`~physiomotion4d.usd_tools` - USD file utilities
102102
* :mod:`~physiomotion4d.usd_anatomy_tools` - Anatomical structure tools
103-
* :class:`~physiomotion4d.ConvertVTK4DToUSD` - VTK to USD conversion
103+
* :class:`~physiomotion4d.ConvertVTKToUSD` - VTK to USD conversion
104104

105105
Module Index
106106
============

docs/api/usd/index.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ Convert VTK to USD
4747

4848
.. code-block:: python
4949
50-
from physiomotion4d import ConvertVTK4DToUSD
50+
from physiomotion4d import ConvertVTKToUSD
5151
52-
converter = ConvertVTK4DToUSD(
52+
converter = ConvertVTKToUSD(
5353
output_file="animated_heart.usd",
5454
colormap="rainbow",
5555
verbose=True

docs/api/usd/polymesh.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Surface mesh (polygon mesh) representation in USD.
99
Class Reference
1010
===============
1111

12-
.. autoclass:: ConvertVTK4DToUSDPolyMesh
12+
.. autoclass:: ConvertVTKToUSDPolyMesh
1313
:members:
1414
:undoc-members:
1515
:show-inheritance:

docs/api/usd/tetmesh.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Tetrahedral mesh representation in USD for volumetric models.
99
Class Reference
1010
===============
1111

12-
.. autoclass:: ConvertVTK4DToUSDTetMesh
12+
.. autoclass:: ConvertVTKToUSDTetMesh
1313
:members:
1414
:undoc-members:
1515
:show-inheritance:

docs/api/usd/vtk_conversion.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Convert VTK mesh files to USD format with animation support.
99
Class Reference
1010
===============
1111

12-
.. autoclass:: ConvertVTK4DToUSD
12+
.. autoclass:: ConvertVTKToUSD
1313
:members:
1414
:undoc-members:
1515
:show-inheritance:

docs/architecture.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ Core Components
4646

4747
5. **USD Export Module**
4848

49-
* :class:`ConvertVTK4DToUSD`: VTK to USD conversion
49+
* :class:`ConvertVTKToUSD`: VTK to USD conversion
5050
* :class:`USDTools`: USD manipulation
5151
* :class:`USDAnatomyTools`: Material application
5252

docs/developer/architecture.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,10 @@ The package is organized into functional modules:
6969
│ └── register_models_pca.py PCA-based
7070
7171
├── USD Generation
72-
│ ├── convert_vtk_4d_to_usd_base.py Base converter
73-
│ ├── convert_vtk_4d_to_usd_polymesh.py Polygon meshes
74-
│ ├── convert_vtk_4d_to_usd_tetmesh.py Tetrahedral meshes
75-
│ └── convert_vtk_4d_to_usd.py Main converter
72+
│ ├── convert_vtk_to_usd_base.py Base converter
73+
│ ├── convert_vtk_to_usd_polymesh.py Polygon meshes
74+
│ ├── convert_vtk_to_usd_tetmesh.py Tetrahedral meshes
75+
│ └── convert_vtk_to_usd.py Main converter
7676
7777
└── Utilities
7878
├── image_tools.py Image manipulation
@@ -107,9 +107,9 @@ Most PhysioMotion4D classes inherit from :class:`PhysioMotion4DBase`:
107107
│ │ └── RegisterImagesICON
108108
│ └── (Model registration classes)
109109
└── Conversion Classes
110-
└── ConvertVTK4DToUSDBase
111-
├── ConvertVTK4DToUSDPolyMesh
112-
└── ConvertVTK4DToUSDTetMesh
110+
└── ConvertVTKToUSDBase
111+
├── ConvertVTKToUSDPolyMesh
112+
└── ConvertVTKToUSDTetMesh
113113
114114
The base class provides:
115115

docs/developer/extending.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ Start with this template for new workflows:
5454
from physiomotion4d import PhysioMotion4DBase
5555
from physiomotion4d import SegmentChestTotalSegmentator
5656
from physiomotion4d import RegisterImagesICON
57-
from physiomotion4d import ConvertVTK4DToUSDPolyMesh
57+
from physiomotion4d import ConvertVTKToUSDPolyMesh
5858
5959
class MyCustomWorkflow(PhysioMotion4DBase):
6060
"""
@@ -95,7 +95,7 @@ Start with this template for new workflows:
9595
"""Initialize processing components."""
9696
self.segmentator = SegmentChestTotalSegmentator(verbose=self.verbose)
9797
self.registrator = RegisterImagesICON(device="cuda:0")
98-
self.usd_converter = ConvertVTK4DToUSDPolyMesh(verbose=self.verbose)
98+
self.usd_converter = ConvertVTKToUSDPolyMesh(verbose=self.verbose)
9999
100100
def process(self):
101101
"""Execute complete workflow."""
@@ -146,7 +146,7 @@ Complete example of a custom workflow:
146146
from physiomotion4d import PhysioMotion4DBase
147147
from physiomotion4d.image_tools import read_image, write_image
148148
from physiomotion4d.contour_tools import extract_surface_mesh
149-
from physiomotion4d import ConvertVTK4DToUSD
149+
from physiomotion4d import ConvertVTKToUSD
150150
import SimpleITK as sitk
151151
152152
class BrainVesselWorkflow(PhysioMotion4DBase):
@@ -189,7 +189,7 @@ Complete example of a custom workflow:
189189
190190
# Convert to USD
191191
usd_file = f"{self.output_directory}/brain_vessels.usd"
192-
converter = ConvertVTK4DToUSD()
192+
converter = ConvertVTKToUSD()
193193
converter.convert(
194194
vtk_file=vessel_mesh,
195195
usd_file=usd_file,

docs/developer/usd_generation.rst

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,17 @@ PhysioMotion4D provides comprehensive USD conversion capabilities:
2222
* **Anatomical Materials**: Organ-specific material painting
2323
* **Time-Varying Geometry**: 4D animation support
2424

25-
All converters inherit from :class:`ConvertVTK4DToUSDBase`.
25+
All converters inherit from :class:`ConvertVTKToUSDBase`.
2626

2727
Base Converter Class
2828
====================
2929

30-
ConvertVTK4DToUSDBase
30+
ConvertVTKToUSDBase
3131
---------------------
3232

3333
Abstract base class for USD conversion.
3434

35-
.. autoclass:: physiomotion4d.ConvertVTK4DToUSDBase
35+
.. autoclass:: physiomotion4d.ConvertVTKToUSDBase
3636
:members:
3737
:undoc-members:
3838
:show-inheritance:
@@ -51,7 +51,7 @@ Polygon Mesh Converter
5151

5252
Convert surface meshes (VTK PolyData) to USD.
5353

54-
.. autoclass:: physiomotion4d.ConvertVTK4DToUSDPolyMesh
54+
.. autoclass:: physiomotion4d.ConvertVTKToUSDPolyMesh
5555
:members:
5656
:undoc-members:
5757
:show-inheritance:
@@ -66,10 +66,10 @@ Convert surface meshes (VTK PolyData) to USD.
6666

6767
.. code-block:: python
6868
69-
from physiomotion4d import ConvertVTK4DToUSDPolyMesh
69+
from physiomotion4d import ConvertVTKToUSDPolyMesh
7070
7171
# Initialize converter
72-
converter = ConvertVTK4DToUSDPolyMesh(
72+
converter = ConvertVTKToUSDPolyMesh(
7373
start_time=0,
7474
end_time=1.0,
7575
fps=30,
@@ -137,7 +137,7 @@ Tetrahedral Mesh Converter
137137

138138
Convert volumetric meshes (VTK UnstructuredGrid) to USD.
139139

140-
.. autoclass:: physiomotion4d.ConvertVTK4DToUSDTetMesh
140+
.. autoclass:: physiomotion4d.ConvertVTKToUSDTetMesh
141141
:members:
142142
:undoc-members:
143143
:show-inheritance:
@@ -152,10 +152,10 @@ Convert volumetric meshes (VTK UnstructuredGrid) to USD.
152152

153153
.. code-block:: python
154154
155-
from physiomotion4d import ConvertVTK4DToUSDTetMesh
155+
from physiomotion4d import ConvertVTKToUSDTetMesh
156156
157157
# Initialize for tetrahedral meshes
158-
converter = ConvertVTK4DToUSDTetMesh(verbose=True)
158+
converter = ConvertVTKToUSDTetMesh(verbose=True)
159159
160160
# Convert volumetric mesh
161161
converter.convert(
@@ -263,10 +263,10 @@ Create animated USD files from 4D VTK sequences:
263263

264264
.. code-block:: python
265265
266-
from physiomotion4d import ConvertVTK4DToUSD
266+
from physiomotion4d import ConvertVTKToUSD
267267
268268
# Initialize with timing
269-
converter = ConvertVTK4DToUSD(
269+
converter = ConvertVTKToUSD(
270270
start_time=0.0,
271271
end_time=2.0, # 2 second animation
272272
fps=30, # 30 frames per second
@@ -290,7 +290,7 @@ Control temporal resolution:
290290
.. code-block:: python
291291
292292
# High temporal resolution
293-
converter = ConvertVTK4DToUSD(
293+
converter = ConvertVTKToUSD(
294294
start_time=0,
295295
end_time=1.0,
296296
fps=60 # Smooth animation
@@ -300,7 +300,7 @@ Control temporal resolution:
300300
num_frames = len(vtk_files)
301301
cycle_duration = 1.0 # 1 second cardiac cycle
302302
303-
converter = ConvertVTK4DToUSD(
303+
converter = ConvertVTKToUSD(
304304
start_time=0,
305305
end_time=cycle_duration,
306306
fps=num_frames / cycle_duration
@@ -316,9 +316,9 @@ Visualize scalar data on meshes:
316316

317317
.. code-block:: python
318318
319-
from physiomotion4d import ConvertVTK4DToUSDPolyMesh
319+
from physiomotion4d import ConvertVTKToUSDPolyMesh
320320
321-
converter = ConvertVTK4DToUSDPolyMesh()
321+
converter = ConvertVTKToUSDPolyMesh()
322322
323323
# Available colormaps
324324
colormaps = [
@@ -423,7 +423,7 @@ Create multi-resolution meshes:
423423

424424
.. code-block:: python
425425
426-
class LODConverter(ConvertVTK4DToUSDPolyMesh):
426+
class LODConverter(ConvertVTKToUSDPolyMesh):
427427
"""Converter with LOD support."""
428428
429429
def create_lod_mesh(self, vtk_file, usd_file, lod_levels):
@@ -508,7 +508,7 @@ Convert multiple files efficiently:
508508
509509
def batch_convert_to_usd(vtk_dir, usd_dir, num_workers=4):
510510
"""Convert multiple VTK files to USD in parallel."""
511-
converter = ConvertVTK4DToUSDPolyMesh()
511+
converter = ConvertVTKToUSDPolyMesh()
512512
513513
vtk_files = list(Path(vtk_dir).glob("*.vtk"))
514514

0 commit comments

Comments
 (0)