Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion httomo/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,12 @@ def check(pipeline: Union[Path, str], in_data_file: Optional[Path] = None):
is_flag=True,
help="Save intermediate images (snapshots) from some methods in the pipeline.",
)
@click.option(
"--bits_sweep_images",
type=click.INT,
default=32,
help="Change the bit depth of saved tiff images in the sweep run from default 32 bit to 16 or 8 bit tiffs.",
)
@click.option(
"--monitor",
type=click.STRING,
Expand Down Expand Up @@ -257,6 +263,7 @@ def run(
output_folder_name: Optional[Path],
gpu_id: int,
save_all: bool,
bits_sweep_images: int,
reslice_dir: Union[Path, None],
max_cpu_slices: int,
max_memory: str,
Expand Down Expand Up @@ -320,6 +327,7 @@ def run(
else pipeline
),
save_all,
bits_sweep_images,
method_wrapper_comm,
format_enum,
)
Expand Down Expand Up @@ -491,6 +499,7 @@ def generate_pipeline(
in_data_file: Path,
pipeline: Union[Path, str],
save_all: bool,
bits_sweep_images: int,
method_wrapper_comm: MPI.Comm,
pipeline_format: PipelineFormat,
) -> Pipeline:
Expand All @@ -504,7 +513,9 @@ def generate_pipeline(
pipeline_object = init_UiLayer.build_pipeline()

# perform transformations on pipeline
tr = TransformLayer(comm=method_wrapper_comm, save_all=save_all)
tr = TransformLayer(
comm=method_wrapper_comm, save_all=save_all, bits_sweep_images=bits_sweep_images
)
pipeline_object = tr.transform(pipeline_object)

return pipeline_object
Expand Down
3 changes: 3 additions & 0 deletions httomo/transform_layer.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,12 @@ def __init__(
comm: MPI.Comm,
repo=MethodDatabaseRepository(),
save_all=False,
bits_sweep_images=32,
out_dir: Optional[os.PathLike] = None,
):
self._repo = repo
self._save_all = save_all
self._bits_sweep_images = bits_sweep_images
self._comm = comm
self._out_dir = out_dir if out_dir is not None else httomo.globals.run_out_dir

Expand Down Expand Up @@ -162,6 +164,7 @@ def insert_save_images_after_sweep(self, pipeline: Pipeline) -> Pipeline:
task_id=f"saveimage_sweep_{m.task_id}",
subfolder_name="images_sweep_" + str(m.method_name),
axis=1,
bit_depth=self._bits_sweep_images,
),
)
sweep_before = True
Expand Down
Loading