1+ """Tests for the automatic dataset definition functionality in the BDV module."""
2+
13import logging
24
35from imcflibs import pathtools
46from imcflibs .imagej import bdv
57
68
7- def set_default_values (project_filename , file_path ):
9+ def set_default_values (
10+ project_filename , file_path , series_type = "Tiles"
11+ ):
812 """Set the default values for dataset definitions.
913
1014 Parameters
@@ -13,9 +17,11 @@ def set_default_values(project_filename, file_path):
1317 Name of the project
1418 file_path : pathlib.Path
1519 Path to a temporary folder
20+ series_type : str, optional
21+ Type of Bioformats series (default is "Tiles")
1622
1723 Returns
18- ----------
24+ -------
1925 str
2026 Start of the options for dataset definitions.
2127 """
@@ -32,15 +38,17 @@ def set_default_values(project_filename, file_path):
3238 + file_info ["path" ]
3339 + "] "
3440 + "exclude=10 "
41+ + "bioformats_series_are?="
42+ + series_type
43+ + " "
3544 + "move_tiles_to_grid_(per_angle)?=[Do not move Tiles to Grid (use Metadata if available)] "
3645 )
3746
3847 return options
3948
4049
4150def test_define_dataset_auto_tile (tmp_path , caplog ):
42- """
43- Test automatic dataset definition method for tile series.
51+ """Test automatic dataset definition method for tile series.
4452
4553 Parameters
4654 ----------
@@ -69,18 +77,22 @@ def test_define_dataset_auto_tile(tmp_path, caplog):
6977 bf_series_type = "Tiles"
7078
7179 # Define the ImageJ command
72- cmd = "Define dataset ... "
80+ cmd = "Define Multi-View Dataset "
7381
7482 # Set the default values for dataset definitions
7583 options = set_default_values (project_filename , file_path )
7684
7785 # Construct the options for dataset definitions
7886 options = (
7987 options
80- + "how_to_load_images =["
88+ + "how_to_store_input_images =["
8189 + "Re-save as multiresolution HDF5"
8290 + "] "
83- + "dataset_save_path=["
91+ + "load_raw_data_virtually "
92+ + "metadata_save_path=["
93+ + result_folder
94+ + "] "
95+ + "image_data_save_path=["
8496 + result_folder
8597 + "] "
8698 + "check_stack_sizes "
@@ -94,14 +106,15 @@ def test_define_dataset_auto_tile(tmp_path, caplog):
94106 final_call = "IJ.run(cmd=[%s], params=[%s])" % (cmd , options )
95107
96108 # Define the dataset using the "Auto-Loader" option
97- bdv .define_dataset_auto (project_filename , file_path , bf_series_type )
109+ bdv .define_dataset_auto (
110+ project_filename , file_info ["path" ], bf_series_type
111+ )
98112 # Check if the final call is in the log
99113 assert final_call == caplog .messages [0 ]
100114
101115
102116def test_define_dataset_auto_angle (tmp_path , caplog ):
103- """
104- Test automatic dataset definition method for angle series.
117+ """Test automatic dataset definition method for angle series.
105118
106119 Parameters
107120 ----------
@@ -133,15 +146,21 @@ def test_define_dataset_auto_angle(tmp_path, caplog):
133146 cmd = "Define Multi-View Dataset"
134147
135148 # Set the default values for dataset definitions
136- options = set_default_values (project_filename , file_path )
149+ options = set_default_values (
150+ project_filename , file_path , bf_series_type
151+ )
137152
138153 # Construct the options for dataset definitions
139154 options = (
140155 options
141- + "how_to_load_images =["
156+ + "how_to_store_input_images =["
142157 + "Re-save as multiresolution HDF5"
143158 + "] "
144- + "dataset_save_path=["
159+ + "load_raw_data_virtually "
160+ + "metadata_save_path=["
161+ + result_folder
162+ + "] "
163+ + "image_data_save_path=["
145164 + result_folder
146165 + "] "
147166 + "check_stack_sizes "
@@ -156,6 +175,8 @@ def test_define_dataset_auto_angle(tmp_path, caplog):
156175 final_call = "IJ.run(cmd=[%s], params=[%s])" % (cmd , options )
157176
158177 # Define the dataset using the "Auto-Loader" option
159- bdv .define_dataset_auto (project_filename , file_path , bf_series_type )
178+ bdv .define_dataset_auto (
179+ project_filename , file_info ["path" ], bf_series_type
180+ )
160181 # Check if the final call is in the log
161182 assert final_call == caplog .messages [0 ]
0 commit comments