You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
performing stitching on channel Alexa488 with id number 0
quantifying alignment error 1000/1000
aligning edge 3901/3901
WARNING:root:Folder C:\Users\bias\AppData\Local\Temp\temp_mmap_ckhrll70 with temp mmap arrays is being deleted. All existing temp mmapp arrays will be unusable!
WARNING:root:New temp folder location. Temp mmap arrays are written to ..\24_11_01_scportrait_windows_test\temp_mmap_jn9d_yg3. Cleanup of this folder is OS dependant, and might need to be triggered manually!
Alignment complete.
assembling mosaic with shape (4, 151184, 51196)
created tempmmap array for assembled mosaic at ...\24_11_01_scportrait_windows_test\temp_mmap_jn9d_yg3\temp_mmap_583388589321156577.hdf
File D:\scportrait\scPortrait\src\scportrait\tools\stitch_stitch.py:449, in Stitcher.stitch(self)
445 """
446 Perform the stitching process.
447 """
448 self.perform_alignment()
--> 449 self.generate_mosaic()
File D:\scportrait\scPortrait\src\scportrait\tools\stitch_stitch.py:442, in Stitcher.generate_mosaic(self)
440 # ensure dtype is set correctly
441 self.mosaic.dtype = np.uint16
--> 442 self.assemble_mosaic()
File D:\scportrait\scPortrait\src\scportrait\tools\stitch_stitch.py:415, in Stitcher.assemble_mosaic(self)
413 hdf5_path = create_empty_mmap(shape, dtype=np.uint16, tmp_dir_abs_path=self.TEMP_DIR_NAME)
414 print(f"created tempmmap array for assembled mosaic at {hdf5_path}")
--> 415 self.assembled_mosaic = mmap_array_from_path(hdf5_path)
416 self.hdf5_path = hdf5_path # save variable into self for easier access
418 # assemble each of the channels
File ~\anaconda3\envs\scportrait\Lib\site-packages\alphabase\io\tempmmap.py:262, in mmap_array_from_path(hdf_file)
258 with open(path, "rb+") as raw_hdf_file:
259 mmap_obj = mmap.mmap(raw_hdf_file.fileno(), 0, access=mmap.ACCESS_WRITE)
260 return np.frombuffer(
261 mmap_obj, dtype=dtype, count=np.prod(shape), offset=offset
--> 262 ).reshape(shape)
ValueError: cannot reshape array of size 895293184 into shape (4,151184,51196)
The text was updated successfully, but these errors were encountered:
Initialization of stitcher and generation of thumbnail works but during stitching an error occurs:
stitcher = Stitcher(os.path.abspath(input_dir),
slidename,
outdir,
pattern = pattern,
stitching_channel = stitching_channel,
overlap= overlap,
max_shift= max_shift,
filter_sigma = 0,
rescale_range = (1,99),
overwrite=True)
stitcher.generate_thumbnail()
stitcher.stitch()
Output:
performing stitching on channel Alexa488 with id number 0
quantifying alignment error 1000/1000
aligning edge 3901/3901
WARNING:root:Folder C:\Users\bias\AppData\Local\Temp\temp_mmap_ckhrll70 with temp mmap arrays is being deleted. All existing temp mmapp arrays will be unusable!
WARNING:root:New temp folder location. Temp mmap arrays are written to ..\24_11_01_scportrait_windows_test\temp_mmap_jn9d_yg3. Cleanup of this folder is OS dependant, and might need to be triggered manually!
Alignment complete.
assembling mosaic with shape (4, 151184, 51196)
created tempmmap array for assembled mosaic at ...\24_11_01_scportrait_windows_test\temp_mmap_jn9d_yg3\temp_mmap_583388589321156577.hdf
ValueError Traceback (most recent call last)
Cell In[13], line 1
----> 1 stitcher.stitch()
File D:\scportrait\scPortrait\src\scportrait\tools\stitch_stitch.py:449, in Stitcher.stitch(self)
445 """
446 Perform the stitching process.
447 """
448 self.perform_alignment()
--> 449 self.generate_mosaic()
File D:\scportrait\scPortrait\src\scportrait\tools\stitch_stitch.py:442, in Stitcher.generate_mosaic(self)
440 # ensure dtype is set correctly
441 self.mosaic.dtype = np.uint16
--> 442 self.assemble_mosaic()
File D:\scportrait\scPortrait\src\scportrait\tools\stitch_stitch.py:415, in Stitcher.assemble_mosaic(self)
413 hdf5_path = create_empty_mmap(shape, dtype=np.uint16, tmp_dir_abs_path=self.TEMP_DIR_NAME)
414 print(f"created tempmmap array for assembled mosaic at {hdf5_path}")
--> 415 self.assembled_mosaic = mmap_array_from_path(hdf5_path)
416 self.hdf5_path = hdf5_path # save variable into self for easier access
418 # assemble each of the channels
File ~\anaconda3\envs\scportrait\Lib\site-packages\alphabase\io\tempmmap.py:262, in mmap_array_from_path(hdf_file)
258 with open(path, "rb+") as raw_hdf_file:
259 mmap_obj = mmap.mmap(raw_hdf_file.fileno(), 0, access=mmap.ACCESS_WRITE)
260 return np.frombuffer(
261 mmap_obj, dtype=dtype, count=np.prod(shape), offset=offset
--> 262 ).reshape(shape)
ValueError: cannot reshape array of size 895293184 into shape (4,151184,51196)
The text was updated successfully, but these errors were encountered: