Skip to content

Commit 60fc7ef

Browse files
committed
dev(process): adapt to cleaner API for image processing. Some cleanup and mypy.
1 parent caed9a3 commit 60fc7ef

5 files changed

Lines changed: 6 additions & 281 deletions

File tree

src/Background.py

Lines changed: 0 additions & 146 deletions
This file was deleted.

src/img_proc/process.py

Lines changed: 0 additions & 132 deletions
This file was deleted.

src/modern/jobs/VerifiedSepToUpload.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,9 @@ def adaptative_upload(
205205
meta_for_scan = find_scan_metadata(
206206
all_scans_meta, self.sample_name, self.scan_name
207207
)
208+
assert (
209+
meta_for_scan is not None
210+
), f"Not found, line for {self.sample_name} in {self.zoo_project.name} metadata"
208211
acq_orig_id = meta_for_scan["fracid"] + "_" + self.sample_name
209212
# Get all acquisitions for project
210213
all_acqs: List[AcquisitionModel] = client.list_acquisitions(dst_project_id)

src/modern/jobs/VignettesToAutoSep.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ def convert_scan_and_backgrounds(
177177
):
178178
logger.info(f"Converting backgrounds")
179179
bg_converted_files = [
180-
processor.converter.do_file_to_image(a_raw_bg_file)
180+
processor.converter.do_file_to_image(a_raw_bg_file, True)
181181
for a_raw_bg_file in bg_scans
182182
]
183183
logger.info(f"Combining backgrounds")
@@ -187,7 +187,7 @@ def convert_scan_and_backgrounds(
187187
# Scan pre-processing
188188
logger.info(f"Converting scan")
189189
eight_bit_scan_image, scan_resolution = processor.converter.do_file_to_image(
190-
raw_scan
190+
raw_scan, False
191191
)
192192
# Background removal
193193
logger.info(f"Removing background")

src/routers/subsamples.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -521,7 +521,7 @@ async def get_subsample_scan(
521521
raw_sample_file = zoo_project.zooscan_scan.raw.get_file(
522522
subsample_name, THE_SCAN_PER_SUBSAMPLE
523523
)
524-
processor.converter.do_file_to_file(raw_sample_file, real_file)
524+
processor.converter.do_file_to_file(raw_sample_file, real_file, False)
525525
else:
526526
real_files: List[Path] = list(
527527
filter(

0 commit comments

Comments
 (0)