Fix to CSM scaling for Fiji config as images are now captured at double width
This commit is contained in:
parent
d1908eb29a
commit
c2f1b591b1
1 changed files with 4 additions and 3 deletions
|
|
@ -148,6 +148,8 @@ def generate_config(folder_path: str, positions: list, names: list, camera_to_sa
|
||||||
positions = np.array(positions)
|
positions = np.array(positions)
|
||||||
mean_loc = np.mean(positions, axis = 0)
|
mean_loc = np.mean(positions, axis = 0)
|
||||||
|
|
||||||
|
#TODO: positions from recent scans need to be 2x bigger - change to CSM res?
|
||||||
|
|
||||||
camera_to_sample_matrix = scale_csm(camera_to_sample_matrix, csm_calibration_width, img_width)
|
camera_to_sample_matrix = scale_csm(camera_to_sample_matrix, csm_calibration_width, img_width)
|
||||||
|
|
||||||
with open(os.path.join(folder_path, 'TileConfiguration.txt'), 'w') as fp:
|
with open(os.path.join(folder_path, 'TileConfiguration.txt'), 'w') as fp:
|
||||||
|
|
@ -422,9 +424,6 @@ class SmartScanThing(Thing):
|
||||||
# camera and stage may not be aligned).
|
# camera and stage may not be aligned).
|
||||||
CSM = csm.image_to_stage_displacement_matrix
|
CSM = csm.image_to_stage_displacement_matrix
|
||||||
csm_calibration_width = csm.last_calibration["image_resolution"][1]
|
csm_calibration_width = csm.last_calibration["image_resolution"][1]
|
||||||
|
|
||||||
# TODO: this downsampling by two is to deal with a camera issue
|
|
||||||
img_width = int(arr.shape[1] / 2)
|
|
||||||
|
|
||||||
overlap = self.overlap
|
overlap = self.overlap
|
||||||
|
|
||||||
|
|
@ -540,6 +539,8 @@ class SmartScanThing(Thing):
|
||||||
width, height = img.size
|
width, height = img.size
|
||||||
img = img.resize((int(width*0.5), int(height*0.5)))
|
img = img.resize((int(width*0.5), int(height*0.5)))
|
||||||
|
|
||||||
|
img_width, _ = img.size
|
||||||
|
|
||||||
logger.info(f"Saving {name}")
|
logger.info(f"Saving {name}")
|
||||||
img.save(
|
img.save(
|
||||||
os.path.join(images_folder, name),
|
os.path.join(images_folder, name),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue