Skip to content

Commit 387c945

Browse files
committed
Docstring format fixes
1 parent 38c7d1c commit 387c945

1 file changed

Lines changed: 96 additions & 88 deletions

File tree

src/imcflibs/imagej/bdv.py

Lines changed: 96 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -67,17 +67,17 @@ def run_define_dataset_autoloader(
6767
bf_series_type : str
6868
One of "Angles" or "Tiles", specifying how Bio-Formats interprets the series.
6969
timepoints_per_partition : int, optional
70-
Split the output by timepoints. Use 0 for no split, by default 1.
70+
Split the output by timepoints. Use `0` for no split, by default `1`.
7171
resave : str, optional
7272
Allow the function to either re-save the images or simply create a
73-
merged xml. Use "Load raw data" to avoid re-saving, by default "Re-save
74-
as multiresolution HDF5" will resave the input data.
75-
subsampling_factors: str, optional
73+
merged xml. Use `Load raw data` to avoid re-saving, by default `Re-save
74+
as multiresolution HDF5` which will resave the input data.
75+
subsampling_factors : str, optional
7676
Specify subsampling factors explicitly, for example:
7777
`[{ {1,1,1}, {2,2,1}, {4,4,2}, {8,8,4} }]`.
78-
hdf5_chunk_sizes: str, optional
78+
hdf5_chunk_sizes : str, optional
7979
Specify hdf5_chunk_sizes factors explicitly, for example
80-
`[{ {32,16,8}, {16,16,16}, {16,16,16}, {16,16,16} }]`
80+
`[{ {32,16,8}, {16,16,16}, {16,16,16}, {16,16,16} }]`.
8181
"""
8282
# FIXME: the docstring is actually not corrct, in the sense that the function will
8383
# switch to `Define dataset ...` in case the `bf_series_type` is `Tiles`
@@ -263,19 +263,19 @@ def run_resave_as_h5(
263263
source_xml_file : File or str
264264
XML input file.
265265
output_h5_file_path : str
266-
Export path for the output file including .xml extension
266+
Export path for the output file including the `.xml `extension.
267267
timepoints : str, optional
268-
Which timepoints should be exported, by default "All Timepoints".
268+
The timepoints that should be exported, by default `All Timepoints`.
269269
timepoints_per_partition : int, optional
270-
How many timepoints per partition should be exported, by default 1.
270+
How many timepoints to export per partition, by default `1`.
271271
use_deflate_compression : bool, optional
272-
Run deflate compression, by default True.
273-
subsampling_factors: str, optional
274-
Allow specifying subsampling factors explicitly, for example:
275-
"[{ {1,1,1}, {2,2,1}, {4,4,2}, {8,8,4} }]"
276-
hdf5_chunk_sizes: str, optional
277-
Allow specifying hdf5_chunk_sizes factors explicitly, for example
278-
"[{ {32,16,8}, {16,16,16}, {16,16,16}, {16,16,16} }]"
272+
Run deflate compression, by default `True`.
273+
subsampling_factors : str, optional
274+
Specify subsampling factors explicitly, for example:
275+
`[{ {1,1,1}, {2,2,1}, {4,4,2}, {8,8,4} }]`.
276+
hdf5_chunk_sizes : str, optional
277+
Specify hdf5_chunk_sizes factors explicitly, for example
278+
`[{ {32,16,8}, {16,16,16}, {16,16,16}, {16,16,16} }]`.
279279
"""
280280
# save all timepoints or a single one:
281281
if timepoints == "All Timepoints":
@@ -336,19 +336,22 @@ def run_resave_as_h5(
336336

337337

338338
def run_flip_axes(source_xml_file, x=False, y=True, z=False):
339-
"""Wrapper for BigStitcher > Batch Processing > Tools > Flip axes.
340-
For example, nd2 files require a flip along the y axis.
339+
"""Call BigStitcher's "Flip Axes" command.
340+
341+
Wrapper for `BigStitcher > Batch Processing > Tools > Flip Axes`. This is
342+
required for some formats, for example Nikon `.nd2` files need a flip along
343+
the Y-axis.
341344
342345
Parameters
343346
----------
344-
h5_resave_xml_path : str
345-
full path to the .xml-file
347+
source_xml_file : str
348+
Full path to the `.xml` file.
346349
x : bool, optional
347-
flip images along the x axes, by default False
350+
Flip images along the X-axis, by default `False`.
348351
y : bool, optional
349-
flip mages along the axes, by default True
352+
Flip mages along the Y-axis, by default `True`.
350353
z : bool, optional
351-
flip images along the z axes, by default False
354+
Flip images along the Z-axis, by default `False`.
352355
"""
353356

354357
file_info = pathtools.parse_path(source_xml_file)
@@ -376,29 +379,28 @@ def run_phase_correlation_pairwise_shifts_calculation(
376379
treat_tiles="group",
377380
downsampling_xyz="",
378381
):
379-
"""Run the Pairwise shifts calculation using Phase Correlation
382+
"""Calculate pairwise shifts using Phase Correlation.
380383
381384
Parameters
382385
----------
383386
project_path : str
384-
Path to the XML
387+
Full path to the `.xml` file.
385388
input_dict : dict
386-
Dictionary containing all the required information for angle, channel,
387-
illuminations and timepoints
389+
Options dict containing the required information for angle, channel,
390+
illuminations and timepoints.
388391
treat_timepoints : str, optional
389-
How to deal with the timepoints, by default "group"
392+
How to deal with the timepoints, by default `group`.
390393
treat_channels : str, optional
391-
How to deal with the channels, by default "group"
394+
How to deal with the channels, by default `group`.
392395
treat_illuminations : str, optional
393-
How to deal with the illuminations, by default "group"
396+
How to deal with the illuminations, by default `group`.
394397
treat_angles : str, optional
395-
How to deal with the angles, by default "[treat individually]"
398+
How to deal with the angles, by default `[treat individually]`.
396399
treat_tiles : str, optional
397-
How to deal with the tiles, by default "group"
400+
How to deal with the tiles, by default `group`.
398401
downsampling_xyz : list of int, optional
399-
specify downsampling in x,y and z, e.g. [4,4,4], by default empty,
400-
meaning BigStitcher chooses
401-
402+
Downsampling factors in X, Y and Z, for example `[4,4,4]`. By default
403+
empty which will result in BigStitcher choosing the factors.
402404
"""
403405

404406
# FIXME: input_dict is not a good parameter name, plus the parse_options()
@@ -496,22 +498,22 @@ def run_filter_pairwise_shifts(
496498
max_shift_xyz="",
497499
max_displacement="",
498500
):
499-
"""Filter the pairwise shifts based on different thresholds
501+
"""Filter the pairwise shifts based on different thresholds.
500502
501503
Parameters
502504
----------
503505
project_path : str
504-
Path of the XML on which to apply the filters
506+
Path to the `.xml` on which to apply the filters.
505507
min_r : float, optional
506-
Minimal quality of the link to keep, by default 0.7
508+
Minimal quality of the link to keep, by default `0.7`.
507509
max_r : float, optional
508-
Maximal quality of the link to keep, by default 1
509-
max_shift_xyz : list of int, optional
510-
Maximal shift in X, Y and Z in px to keep, e.g. [10,10,10], by default empty,
511-
meaning this option is skipped
510+
Maximal quality of the link to keep, by default `1`.
511+
max_shift_xyz : list(int), optional
512+
Maximal shift in X, Y and Z (in pixels) to keep, e.g. `[10,10,10]`. By
513+
default empty, meaning no filtering based on the shifts will be applied.
512514
max_displacement : int, optional
513-
Maximal displacement to keep, by default empty,
514-
meaning this option is skipped
515+
Maximal displacement to keep. By default empty, meaning no filtering
516+
based on the displacement will be applied.
515517
"""
516518

517519
file_info = pathtools.parse_path(project_path)
@@ -563,29 +565,29 @@ def run_optimize_apply_shifts(
563565
relative_error=2.5,
564566
absolute_error=3.5,
565567
):
566-
"""Optimize the shifts and apply it to the dataset
568+
"""Optimize the shifts and apply them to the dataset.
567569
568570
Parameters
569571
----------
570572
project_path : str
571-
Path of the XML on which to optimize and apply the shifts
573+
Path to the `.xml` on which to optimize and apply the shifts.
572574
input_dict : dict
573575
Dictionary containing all the required information for angles,
574-
channels, illuminations, tiles and timepoints
576+
channels, illuminations, tiles and timepoints.
575577
treat_timepoints : str, optional
576-
How to treat the timepoints, by default "group"
578+
How to treat the timepoints, by default `group`.
577579
treat_channels : str, optional
578-
How to treat the channels, by default "group"
580+
How to treat the channels, by default `group`.
579581
treat_illuminations : str, optional
580-
How to treat the illuminations, by default "group"
582+
How to treat the illuminations, by default `group`.
581583
treat_angles : str, optional
582-
How to treat the angles, by default "[treat individually]"
584+
How to treat the angles, by default `[treat individually]`.
583585
treat_tiles : str, optional
584-
How to treat the tiles, by default "group"
585-
relative_error: float, optional
586-
relative alignment error in px, by default 2.5
587-
absolute_error: float, optional
588-
absolute alignment error in px, by default 3.5
586+
How to treat the tiles, by default `group`.
587+
relative_error : float, optional
588+
Relative alignment error (in px) to accept, by default `2.5`.
589+
absolute_error : float, optional
590+
Absolute alignment error (in px) to accept, by default `3.5`.
589591
"""
590592

591593
# FIXME: input_dict is not a good parameter name, plus the parse_options()
@@ -683,17 +685,17 @@ def run_detect_interest_points(
683685
Parameters
684686
----------
685687
project_path : str
686-
Path to the .xml project
688+
Path to the `.xml` project.
687689
process_timepoint : str, optional
688-
Specify which timepoint should be processed, by default "All Timepoints"
690+
Timepoint to be processed, by default `All Timepoints`.
689691
process_channel : str, optional
690-
Specify which channel should be processed, by default "All channels"
692+
Channel to be processed, by default `All channels`.
691693
sigma : float, optional
692-
Minimum sigma for interest points detection, by default 1.8
694+
Minimum sigma for interest points detection, by default `1.8`.
693695
threshold : float, optional
694-
Threshold value for the interest point detection, by default 0.008
696+
Threshold value for the interest point detection, by default `0.008`.
695697
maximum_number : int, optional
696-
Maximum number of interest points to use, by default 3000.
698+
Maximum number of interest points to use, by default `3000`.
697699
"""
698700

699701
# If not process all channels at once, then adapt the option
@@ -764,22 +766,24 @@ def run_interest_points_registration(
764766
process_channel="All channels",
765767
rigid_timepoints=False,
766768
):
767-
"""Run the registration command.
769+
"""Run the "Register Dataset based on Interest Points" command.
768770
769771
Parameters
770772
----------
771773
project_path : str
772-
Path to the .xml project
774+
Path to the `.xml` project.
773775
process_timepoint : str, optional
774-
Specify which timepoint should be processed, by default "All Timepoints"
776+
Timepoint to be processed, by default `All Timepoints`.
775777
process_channel : str, optional
776-
Specify which channels should be processed. By default, all channels are
777-
processed together, however this behavior could be undesirable if only
778-
one channel is adequate (beads or nuclei). In that case provide the
779-
channel name instead. by default "All channels"
778+
Channels to be used for performing the registration. By default, all
779+
channels are taken into account, however this behavior could be
780+
undesirable if only one channel is adequate (e.g. beads or other useful
781+
fiducials). To restrict registration to a specific channel, provide the
782+
channel name using this parameter. By default `All channels`.
780783
rigid_timepoints : bool, optional
781-
If spatial registration has already been run, set this boolean to True
782-
to consider each timepoint as rigid unit, by default False
784+
If set to `True` each timepoint will be considered as a rigid unit
785+
(useful e.g. if spatial registration has already been performed before).
786+
By default `False`.
783787
"""
784788

785789
# If not process all channels at once, then adapt the option
@@ -844,24 +848,25 @@ def run_duplicate_transformations(
844848
tile_source=None,
845849
transformation_to_use="[Replace all transformations]",
846850
):
847-
"""Duplicate the transformation parameters to the other channels.
851+
"""Duplicate / propagate transformation parameters to other channels.
848852
849-
If registration has been generated using a single channel,this can be used
850-
to propagate it to the others.
853+
Propagate the transformation parameters generated by a previously performed
854+
registration of a single channel to the other channels.
851855
852856
Parameters
853857
----------
854858
project_path : str
855-
Path to the .xml project
859+
Path to the `.xml` project.
856860
transformation_type : str, optional
857-
select mode, e.g. "channel" or "tiles"
861+
Transformation mode, one of `channel` (to propagate from one channel to
862+
all others) and `tiles` (to propagate from one tile to all others).
858863
channel_source : int, optional
859-
number of the reference channel, starts at 1, by default None
860-
tile source : int, optional
861-
the reference tile, by default None
864+
Reference channel nummber (starting at 1), by default None.
865+
tile_source : int, optional
866+
Reference tile, by default None.
862867
transformation_to_use : str, optional
863-
select which transformations to duplicate.
864-
Alternative option: "[Add last transformation only]"
868+
One of `[Replace all transformations]` (default) and `[Add last
869+
transformation only]` to specify which transformations to propagate.
865870
"""
866871
# FIXME: transformation_to_use requires explanations of possible values!
867872

@@ -949,28 +954,31 @@ def run_fusion(
949954
pixel_type="[16-bit unsigned integer]",
950955
export="HDF5",
951956
):
952-
"""Wrapper to BigStitcher > Batch Processing > Fuse Dataset.
957+
"""Call BigStitcher's "Fuse Dataset" command.
958+
959+
Wrapper to `BigStitcher > Batch Processing > Fuse Dataset`.
953960
954961
Depending on the export type, inputs are different and therefore will
955962
distribute inputs differently.
956963
957964
Parameters
958965
----------
959966
project_path : str
960-
Path of the XML on which to do the fusion.
967+
Path to the `.xml` on which to run the fusion.
961968
input_dict : dict
962969
Dictionary containing all the required informations for angles,
963970
channels, illuminations, tiles and timepoints.
964971
result_path : str, optional
965-
Path to store the resulting fused image, by default None.
972+
Path to store the resulting fused image, by default `None` which will
973+
store the result in the same folder as the input project.
966974
downsampling : int, optional
967-
Downsampling value to use during fusion, by default 1.
975+
Downsampling value to use during fusion, by default `1`.
968976
interpolation : str, optional
969-
Interpolation to use during fusion, by default "[Linear Interpolation]".
977+
Interpolation to use during fusion, by default `[Linear Interpolation]`.
970978
pixel_type : str, optional
971-
Pixel type to use during fusion, by default "[16-bit unsigned integer]".
979+
Pixel type to use during fusion, by default `[16-bit unsigned integer]`.
972980
export : str, optional
973-
Format of the output fused image, by default "HDF5".
981+
Format of the output fused image, by default `HDF5`.
974982
"""
975983

976984
file_info = pathtools.parse_path(project_path)

0 commit comments

Comments
 (0)