Skip to content

Commit

Permalink
Dax dev - Zarr Implementation/Created dummy model/Updated paths for p…
Browse files Browse the repository at this point in the history
…ackaging (#113)

* #81 Error handling now in place

* Wired up moving frames to zarr

Co-Authored-By: Dax Collison <[email protected]>

* Thread name printing with exception

Co-Authored-By: Dax Collison <[email protected]>

* Comment

Co-Authored-By: Dax Collison <[email protected]>

* Moving along on zarr saving

Co-Authored-By: Dax Collison <[email protected]>

* Update aslm_image_writer.py

Co-Authored-By: Dax Collison <[email protected]>

* Boolean flags based on stack cycle mode

Co-Authored-By: Dax Collison <[email protected]>

* Zarr array is now updated with data

Still very early and is not ready to be pulled

Co-Authored-By: Dax Collison <[email protected]>

* Removing for loops to add image to zarr array

* Updating copy to zarr function

* Updating test for image writer

* Basic Setup.py

* Synthetic Hardware Test now compatible with structure

* Basic Setup.py

* Revert "Basic Setup.py"

This reverts commit 53385f4.

* Fixing path issues for model tests to run

* Created dummy model

I put the dummy model in the aslm package bc I was having import errors trying to import modules from the test folder.

* Updated paths to absolute

Can now run aslm --sh in command line after installing and will run program

* Adding zarr for github tests

* Update dummy model and apply to tests

* Removing init from test classes

* This will now pass

Aslm Analysis test needs to be addressed as its calling an entropy funciton that doesn't exist where it maybe is supposed to

Co-authored-by: AdvancedImagingUTSW <[email protected]>
  • Loading branch information
codeCollision4 and AdvancedImagingUTSW authored Jun 22, 2022
1 parent 576132c commit 49c5f21
Show file tree
Hide file tree
Showing 48 changed files with 412 additions and 188 deletions.
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ tensorflow==2.8.0
cupy-cuda112==10.2.0
protobuf==3.20.*
zarr==2.11.3

1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@
},
include_package_data=True,
)

36 changes: 18 additions & 18 deletions src/aslm/controller/aslm_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,30 +41,30 @@

# Local View Imports
from tkinter import filedialog
from view.main_application_window import Main_App as view
from view.remote_focus_popup import remote_popup
from view.autofocus_setting_popup import autofocus_popup
from aslm.view.main_application_window import Main_App as view
from aslm.view.remote_focus_popup import remote_popup
from aslm.view.autofocus_setting_popup import autofocus_popup

# Local Sub-Controller Imports
from controller.sub_controllers.stage_gui_controller import Stage_GUI_Controller
from controller.sub_controllers.acquire_bar_controller import Acquire_Bar_Controller
from controller.sub_controllers.channels_tab_controller import Channels_Tab_Controller
from controller.sub_controllers.camera_view_controller import Camera_View_Controller
from controller.sub_controllers.camera_setting_controller import Camera_Setting_Controller
from controller.aslm_configuration_controller import ASLM_Configuration_Controller
from controller.sub_controllers.waveform_tab_controller import Waveform_Tab_Controller
from controller.sub_controllers.etl_popup_controller import Etl_Popup_Controller
from controller.sub_controllers.autofocus_popup_controller import Autofocus_Popup_Controller
from controller.aslm_controller_functions import *
from controller.thread_pool import SynchronizedThreadPool
from aslm.controller.sub_controllers.stage_gui_controller import Stage_GUI_Controller
from aslm.controller.sub_controllers.acquire_bar_controller import Acquire_Bar_Controller
from aslm.controller.sub_controllers.channels_tab_controller import Channels_Tab_Controller
from aslm.controller.sub_controllers.camera_view_controller import Camera_View_Controller
from aslm.controller.sub_controllers.camera_setting_controller import Camera_Setting_Controller
from aslm.controller.aslm_configuration_controller import ASLM_Configuration_Controller
from aslm.controller.sub_controllers.waveform_tab_controller import Waveform_Tab_Controller
from aslm.controller.sub_controllers.etl_popup_controller import Etl_Popup_Controller
from aslm.controller.sub_controllers.autofocus_popup_controller import Autofocus_Popup_Controller
from aslm.controller.aslm_controller_functions import *
from aslm.controller.thread_pool import SynchronizedThreadPool

# Local Model Imports
from model.aslm_model import Model
from model.aslm_model_config import Session as session
from model.concurrency.concurrency_tools import ObjectInSubprocess, SharedNDArray
from aslm.model.aslm_model import Model
from aslm.model.aslm_model_config import Session as session
from aslm.model.concurrency.concurrency_tools import ObjectInSubprocess, SharedNDArray

# debug
from controller.aslm_debug import Debug_Module
from aslm.controller.aslm_debug import Debug_Module

import logging
from pathlib import Path
Expand Down
4 changes: 2 additions & 2 deletions src/aslm/controller/sub_controllers/acquire_bar_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
POSSIBILITY OF SUCH DAMAGE.
"""
import sys
from controller.sub_controllers.gui_controller import GUI_Controller
from view.main_window_content.acquire_bar_frame.acquire_popup import Acquire_PopUp as acquire_popup
from aslm.controller.sub_controllers.gui_controller import GUI_Controller
from aslm.view.main_window_content.acquire_bar_frame.acquire_popup import Acquire_PopUp as acquire_popup

import logging
from pathlib import Path
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
"""
from controller.sub_controllers.gui_controller import GUI_Controller
from controller.aslm_controller_functions import combine_funcs
from aslm.controller.sub_controllers.gui_controller import GUI_Controller
from aslm.controller.aslm_controller_functions import combine_funcs
import time

import logging
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
"""
from controller.sub_controllers.gui_controller import GUI_Controller
from aslm.controller.sub_controllers.gui_controller import GUI_Controller

import logging
from pathlib import Path
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
import numpy as np

# Local Imports
from controller.sub_controllers.gui_controller import GUI_Controller
from aslm.controller.sub_controllers.gui_controller import GUI_Controller

# Logger Setup
p = __name__.split(".")[0]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
"""
from controller.sub_controllers.widget_functions import validate_wrapper
from controller.sub_controllers.gui_controller import GUI_Controller
from aslm.controller.sub_controllers.widget_functions import validate_wrapper
from aslm.controller.sub_controllers.gui_controller import GUI_Controller
import logging
from pathlib import Path
# Logger Setup
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@
POSSIBILITY OF SUCH DAMAGE.
"""
import numpy as np
from controller.sub_controllers.widget_functions import validate_wrapper
from controller.sub_controllers.gui_controller import GUI_Controller
from controller.sub_controllers.channel_setting_controller import Channel_Setting_Controller
from controller.sub_controllers.multi_position_controller import Multi_Position_Controller
from aslm.controller.sub_controllers.widget_functions import validate_wrapper
from aslm.controller.sub_controllers.gui_controller import GUI_Controller
from aslm.controller.sub_controllers.channel_setting_controller import Channel_Setting_Controller
from aslm.controller.sub_controllers.multi_position_controller import Multi_Position_Controller

import logging
from pathlib import Path
Expand Down
6 changes: 3 additions & 3 deletions src/aslm/controller/sub_controllers/etl_popup_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@
"""
from tkinter import filedialog

from controller.sub_controllers.widget_functions import validate_wrapper
from controller.sub_controllers.gui_controller import GUI_Controller
from controller.aslm_controller_functions import save_yaml_file, combine_funcs
from aslm.controller.sub_controllers.widget_functions import validate_wrapper
from aslm.controller.sub_controllers.gui_controller import GUI_Controller
from aslm.controller.aslm_controller_functions import save_yaml_file, combine_funcs

import logging
from pathlib import Path
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
import pandas as pd
from pandastable import TableModel

from controller.sub_controllers.gui_controller import GUI_Controller
from aslm.controller.sub_controllers.gui_controller import GUI_Controller

import logging
from pathlib import Path
Expand Down
4 changes: 2 additions & 2 deletions src/aslm/controller/sub_controllers/stage_gui_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
"""
from controller.sub_controllers.widget_functions import validate_wrapper
from controller.sub_controllers.gui_controller import GUI_Controller
from aslm.controller.sub_controllers.widget_functions import validate_wrapper
from aslm.controller.sub_controllers.gui_controller import GUI_Controller
import logging
from pathlib import Path
# Logger Setup
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
"""
from controller.sub_controllers.gui_controller import GUI_Controller
from aslm.controller.sub_controllers.gui_controller import GUI_Controller
from matplotlib.backends.backend_tkagg import (FigureCanvasTkAgg)
from matplotlib.figure import Figure
import logging
Expand Down
2 changes: 1 addition & 1 deletion src/aslm/log_files/log_functions.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import logging
import logging.config
import logging.handlers
import multiprocessing
import yaml
Expand Down
10 changes: 5 additions & 5 deletions src/aslm/log_files/logging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ formatters:
format: '%(asctime)s - %(name)s - %(levelname)s - %(module)s: %(message)s'
filters:
performance_specs:
(): ext://log_files.filters.PerformanceFilter
(): ext://aslm.log_files.filters.PerformanceFilter
not_performance:
(): ext://log_files.filters.NonPerfFilter
(): ext://aslm.log_files.filters.NonPerfFilter
handlers:
console:
class: logging.StreamHandler
Expand All @@ -20,21 +20,21 @@ handlers:
class: logging.FileHandler
level: INFO
formatter: base
filename: log_files/view_controller_info.log
filename: aslm/log_files/view_controller_info.log
filters: [not_performance]
mode: w
vc_debug:
class: logging.FileHandler
level: DEBUG
formatter: base
filename: log_files/view_controller_debug.log
filename: aslm/log_files/view_controller_debug.log
filters: [not_performance]
mode: w
performance:
class: logging.FileHandler
level: DEBUG
formatter: base
filename: log_files/performance.log
filename: aslm/log_files/performance.log
filters: [performance_specs]
mode: w
loggers:
Expand Down
10 changes: 5 additions & 5 deletions src/aslm/log_files/model_logging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ formatters:
format: '%(asctime)s - %(name)s - %(levelname)s - %(module)s: %(message)s'
filters:
performance_specs:
(): ext://log_files.filters.PerformanceFilter
(): ext://aslm.log_files.filters.PerformanceFilter
not_performance:
(): ext://log_files.filters.NonPerfFilter
(): ext://aslm.log_files.filters.NonPerfFilter
handlers:
console:
class: logging.StreamHandler
Expand All @@ -20,21 +20,21 @@ handlers:
class: logging.FileHandler
level: INFO
formatter: base
filename: log_files/model_info.log
filename: aslm/log_files/model_info.log
filters: [not_performance]
mode: w
model_debug:
class: logging.FileHandler
level: DEBUG
formatter: base
filename: log_files/model_debug.log
filename: aslm/log_files/model_debug.log
filters: [not_performance]
mode: w
model_performance:
class: logging.FileHandler
level: DEBUG
formatter: base
filename: log_files/model_performance.log
filename: aslm/log_files/model_performance.log
filters: [performance_specs]
mode: w
loggers:
Expand Down
4 changes: 2 additions & 2 deletions src/aslm/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@
import platform
import logging
import logging.config
from log_files.log_functions import log_setup
from aslm.log_files.log_functions import log_setup
import yaml

# Local Imports
from controller.aslm_controller import ASLM_controller as controller
from aslm.controller.aslm_controller import ASLM_controller as controller

def main():
"""
Expand Down
4 changes: 2 additions & 2 deletions src/aslm/model/aslm_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
import tensorflow as tf

# Local Imports
from .analysis import image_decorrelation as image_decorrelation
from aslm.model.analysis import image_decorrelation as image_decorrelation

# Logger Setup
p = __name__.split(".")[0]
Expand All @@ -56,7 +56,7 @@ def __init__(self, use_gpu=False, verbose=False):
self.use_gpu = use_gpu

if use_gpu:
from .analysis import flatfield as flatfield
from aslm.model.analysis import flatfield as flatfield

def __del__(self):
pass
Expand Down
6 changes: 3 additions & 3 deletions src/aslm/model/aslm_debug_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@

from multiprocessing import Pool, Lock

from model.aslm_device_startup_functions import start_analysis
from model.concurrency.concurrency_tools import ObjectInSubprocess
from model.aslm_analysis import Analysis
from aslm.model.aslm_device_startup_functions import start_analysis
from aslm.model.concurrency.concurrency_tools import ObjectInSubprocess
from aslm.model.aslm_analysis import Analysis

# Logger Setup
p = __name__.split(".")[0]
Expand Down
Loading

0 comments on commit 49c5f21

Please sign in to comment.