Skip to content

Commit f4e2501

Browse files
authored
Merge pull request #326 from ImagingDataCommons/docs/spatial_transformer_docstrings
Fix spatial transformer `from_images` docstrings
2 parents 1556453 + 7e847c4 commit f4e2501

1 file changed

Lines changed: 57 additions & 24 deletions

File tree

src/highdicom/spatial.py

Lines changed: 57 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2164,7 +2164,7 @@ def __init__(
21642164
of the "from" image expressed in the three-dimensional patient or
21652165
slide coordinate system defined by the frame of reference
21662166
pixel_spacing_from: Sequence[float]
2167-
Spacing between pixels of the "from" imagem in millimeter unit
2167+
Spacing between pixels of the "from" images in millimeter unit
21682168
along the column direction (first value: spacing between rows,
21692169
vertical, top to bottom, increasing row index) and the rows
21702170
direction (second value: spacing between columns: horizontal, left
@@ -2285,18 +2285,34 @@ def for_images(
22852285
22862286
Parameters
22872287
----------
2288-
dataset: pydicom.Dataset
2289-
Dataset representing an image.
2290-
frame_number: Union[int, None], optional
2291-
Frame number (using 1-based indexing) of the frame for which to get
2292-
the transformer. This should be provided if and only if the dataset
2293-
is a multi-frame image.
2294-
for_total_pixel_matrix: bool, optional
2288+
dataset_from: pydicom.Dataset
2289+
Dataset representing the image whose pixel indices will be the
2290+
input to the transformer.
2291+
dataset_to: pydicom.Dataset
2292+
Dataset representing the image whose pixel indices will be the
2293+
output of the transformer.
2294+
frame_number_from: Union[int, None], optional
2295+
Frame number (using 1-based indexing) of the frame of
2296+
``dataset_from`` for which to construct the transformer. This
2297+
should be provided if and only if the dataset is a multi-frame
2298+
image.
2299+
frame_number_to: Union[int, None], optional
2300+
Frame number (using 1-based indexing) of the frame of
2301+
``dataset_to`` for which to construct the transformer. This
2302+
should be provided if and only if the dataset is a multi-frame
2303+
image.
2304+
for_total_pixel_matrix_from: bool, optional
22952305
If True, use the spatial information for the total pixel matrix of
2296-
a tiled image. The result will be a transformer that maps pixel
2297-
indices of the total pixel matrix to frame of reference
2298-
coordinates. This should only be True if the image is a tiled image
2299-
and is incompatible with specifying a frame number.
2306+
the "from" image. The result will be a transformer that whose
2307+
inputs are pixel indices of the total pixel matrix of the "from"
2308+
image. This should only be True if the "from" image is a tiled
2309+
image and is incompatible with specifying ``frame_number_from``.
2310+
for_total_pixel_matrix_to: bool, optional
2311+
If True, use the spatial information for the total pixel matrix of
2312+
the "to" image. The result will be a transformer whose outputs are
2313+
pixel indices of the total pixel matrix of the "to" image. This
2314+
should only be True if the "to" image is a tiled image and is
2315+
incompatible with specifying ``frame_number_to``.
23002316
round_output: bool, optional
23012317
If True, outputs are rounded to the nearest integer. Otherwise,
23022318
they are returned as float.
@@ -2823,7 +2839,7 @@ def __init__(
28232839
of the "from" image expressed in the three-dimensional patient or
28242840
slide coordinate system defined by the frame of reference
28252841
pixel_spacing_from: Sequence[float]
2826-
Spacing between pixels of the "from" imagem in millimeter unit
2842+
Spacing between pixels of the "from" images in millimeter unit
28272843
along the column direction (first value: spacing between rows,
28282844
vertical, top to bottom, increasing row index) and the rows
28292845
direction (second value: spacing between columns: horizontal, left
@@ -2942,18 +2958,35 @@ def for_images(
29422958
29432959
Parameters
29442960
----------
2945-
dataset: pydicom.Dataset
2946-
Dataset representing an image.
2947-
frame_number: Union[int, None], optional
2948-
Frame number (using 1-based indexing) of the frame for which to get
2949-
the transformer. This should be provided if and only if the dataset
2950-
is a multi-frame image.
2951-
for_total_pixel_matrix: bool, optional
2961+
dataset_from: pydicom.Dataset
2962+
Dataset representing the image whose image coordinates will be the
2963+
input to the transformer.
2964+
dataset_to: pydicom.Dataset
2965+
Dataset representing the image whose image coordinates will be the
2966+
output of the transformer.
2967+
frame_number_from: Union[int, None], optional
2968+
Frame number (using 1-based indexing) of the frame of
2969+
``dataset_from`` for which to construct the transformer. This
2970+
should be provided if and only if the dataset is a multi-frame
2971+
image.
2972+
frame_number_to: Union[int, None], optional
2973+
Frame number (using 1-based indexing) of the frame of
2974+
``dataset_to`` for which to construct the transformer. This
2975+
should be provided if and only if the dataset is a multi-frame
2976+
image.
2977+
for_total_pixel_matrix_from: bool, optional
29522978
If True, use the spatial information for the total pixel matrix of
2953-
a tiled image. The result will be a transformer that maps image
2954-
coordinates of the total pixel matrix to frame of reference
2955-
coordinates. This should only be True if the image is a tiled image
2956-
and is incompatible with specifying a frame number.
2979+
the "from" image. The result will be a transformer that whose
2980+
inputs are image coordinates of the total pixel matrix of the
2981+
"from" image. This should only be True if the "from" image is a
2982+
tiled image and is incompatible with specifying
2983+
``frame_number_from``.
2984+
for_total_pixel_matrix_to: bool, optional
2985+
If True, use the spatial information for the total pixel matrix of
2986+
the "to" image. The result will be a transformer whose outputs are
2987+
image coordinates of the total pixel matrix of the "to" image. This
2988+
should only be True if the "to" image is a tiled image and is
2989+
incompatible with specifying ``frame_number_to``.
29572990
29582991
Returns
29592992
-------

0 commit comments

Comments
 (0)