Skip to content

Commit

Permalink
WIP: docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
tbirdso committed Nov 10, 2023
1 parent b9fe1c9 commit bfe4fc1
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ examples/output
examples/mydask.png

data/
_build/
1 change: 1 addition & 0 deletions src/itk_dreg/block/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ def arr_to_continuous_index(index: Union[List, npt.ArrayLike]) -> itk.Continuous
_itkContinuousIndexPython.itkContinuousIndexD3_swiginit(self, _itkContinuousIndexPython.new_itkContinuousIndexD3(*args))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: Expecting a sequence of int (or long)
```
:param arr: The list or array representing a continuous index.
Expand Down
2 changes: 1 addition & 1 deletion src/itk_dreg/block/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def physical_region_to_itk_image(
4. Compute the origin at the centerpoint of the 0th voxel;
5. Compute the output voxel size according to the equation:
size = ((D * S) ^ -1) * (upper_bound - lower_bound)
size = ((D * S) ^ -1) * (upper_bound - lower_bound)
The resulting image is a metadata representation of the relationship
between spaces and has no pixel buffer allocation.
Expand Down
24 changes: 22 additions & 2 deletions src/itk_dreg/reduce_dfield/transform_collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import logging
from dataclasses import dataclass
from typing import List, Type, Optional, Tuple, Callable
from typing import List, Optional, Tuple, Callable

import itk
import numpy as np
Expand All @@ -15,8 +15,28 @@

@dataclass
class TransformEntry:
transform: Type[itk.Transform]
"""
Wraps a single transform for inclusion in a `TransformCollection` with or without a transform domain.
"""

transform: itk.Transform
"""
Transform representing some spatial relationship.
"""
domain: Optional[itk.Image]
"""
The domain over which the transform is valid.
If a value is provided then the is considered to be bounded, meaning it is only valid to
transform a point in real space by this transform if the transform falls within the
physical bounds of the transform domain.
As a convenience, a transform domain is constrained such that it must be representable
with an oriented bounding box in physical space.
An unbuffered `itk.Image` may be used to describe the oriented bounding box. The voxel grid
subdivision of the `itk.Image` is ignored in `TransformCollection` processing.
If `None` then the transform is considered to be unbounded, meaning it is valid to transform
any point in real space by this transform to obtain another point in R^3.
"""


class TransformCollection:
Expand Down

0 comments on commit bfe4fc1

Please sign in to comment.