Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

435 duplicated half images after setting roi size to 2048x1024 #442

Conversation

annie-xd-wang
Copy link
Collaborator

Please test on a Mac to see if resize works well.

@annie-xd-wang annie-xd-wang linked an issue May 5, 2023 that may be closed by this pull request
@codecov-commenter
Copy link

Codecov Report

Merging #442 (c4889d8) into develop (3d17990) will decrease coverage by 0.03%.
The diff coverage is 39.47%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@             Coverage Diff             @@
##           develop     #442      +/-   ##
===========================================
- Coverage    41.81%   41.78%   -0.03%     
===========================================
  Files          151      151              
  Lines        13855    13879      +24     
===========================================
+ Hits          5793     5800       +7     
- Misses        8062     8079      +17     
Flag Coverage Δ
unittests 41.78% <39.47%> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/aslm/controller/controller.py 0.00% <0.00%> (ø)
...ntroller/sub_controllers/camera_view_controller.py 68.72% <58.33%> (+1.08%) ⬆️
src/aslm/model/microscope.py 85.63% <100.00%> (ø)

... and 2 files with indirect coverage changes

@zacsimile
Copy link
Collaborator

zacsimile commented May 8, 2023

It works well on the multiscale windows machine, both displaying and saving properly. It breaks on a mac when I click acquire with a non-square frame.

(aslm) zachmarin@SW562094 ASLM % aslm -sh
2023-05-08 17:25:23,541 - controller - ERROR - camera_setting_controller: could not convert string to float: '' similar to TclError
Traceback (most recent call last):
  File "/Users/zachmarin/opt/miniconda3/envs/ASLM/lib/python3.9/multiprocessing/resource_tracker.py", line 201, in main
    cache[rtype].remove(name)
KeyError: '/psm_314c1e60'
Exception inside ObjectInSubprocess: Traceback (most recent call last):
  File "/Users/zachmarin/Code/ASLM/src/aslm/model/concurrency/concurrency_tools.py", line 93, in __new__
    shm = shared_memory.SharedMemory(create=True, size=requested_bytes)
  File "/Users/zachmarin/opt/miniconda3/envs/ASLM/lib/python3.9/multiprocessing/shared_memory.py", line 114, in __init__
    self._mmap = mmap.mmap(self._fd, size)
OSError: [Errno 24] Too many open files

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/Users/zachmarin/Code/ASLM/src/aslm/model/concurrency/concurrency_tools.py", line 521, in _child_loop
    result = getattr(obj, method_name)(*args, **kwargs)
  File "/Users/zachmarin/Code/ASLM/src/aslm/model/model.py", line 329, in get_data_buffer
    self.update_data_buffer(img_width, img_height)
  File "/Users/zachmarin/Code/ASLM/src/aslm/model/model.py", line 296, in update_data_buffer
    self.data_buffer = [
  File "/Users/zachmarin/Code/ASLM/src/aslm/model/model.py", line 297, in <listcomp>
    SharedNDArray(shape=(img_height, img_width), dtype="uint16")
  File "/Users/zachmarin/Code/ASLM/src/aslm/model/concurrency/concurrency_tools.py", line 96, in __new__
    raise OSError(
OSError: You tried to simultaneously open more SharedNDArrays than are allowed by your system!

Exception in Tkinter callback
Traceback (most recent call last):
  File "/Users/zachmarin/opt/miniconda3/envs/ASLM/lib/python3.9/tkinter/__init__.py", line 1892, in __call__
    return self.func(*args)
  File "/Users/zachmarin/Code/ASLM/src/aslm/controller/sub_controllers/acquire_bar_controller.py", line 296, in launch_popup_window
    self.parent_controller.execute("acquire")
  File "/Users/zachmarin/Code/ASLM/src/aslm/controller/controller.py", line 938, in execute
    if not self.prepare_acquire_data():
  File "/Users/zachmarin/Code/ASLM/src/aslm/controller/controller.py", line 717, in prepare_acquire_data
    self.update_buffer()
  File "/Users/zachmarin/Code/ASLM/src/aslm/controller/controller.py", line 274, in update_buffer
    self.data_buffer = self.model.get_data_buffer(img_width, img_height)
  File "/Users/zachmarin/Code/ASLM/src/aslm/model/concurrency/concurrency_tools.py", line 412, in attr
    return _get_response(self, True)
  File "/Users/zachmarin/Code/ASLM/src/aslm/model/concurrency/concurrency_tools.py", line 433, in _get_response
    raise resp
Exception: You tried to simultaneously open more SharedNDArrays than are allowed by your system!

model_debug.log
view_controller_debug.log

@zacsimile
Copy link
Collaborator

Now might also be a good time to address ROIs. By default, we cut about the middle of the FOV. However, it is perfectly reasonable to create an ROI from, say, (500, 430) to (700, 490) or something similarly random. Perhaps we should implement this in the logic/GUI rather than the width/height and ROI center argument (which is currently disabled).

@zacsimile zacsimile merged commit fc5607f into develop May 10, 2023
@annie-xd-wang annie-xd-wang mentioned this pull request May 26, 2023
@AdvancedImagingUTSW AdvancedImagingUTSW deleted the 435-duplicated-half-images-after-setting-roi-size-to-2048x1024 branch December 15, 2023 01:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Duplicated half-images after setting ROI size to 2048x1024
3 participants