Skip to content

Commit

Permalink
Refactoring of the main classes (#10)
Browse files Browse the repository at this point in the history
* Find optimal threshold for frames

* Assign correct sign for rotation

* Get the rotation angle per tick

* Add draft logic to fit the rotation degree changes to curve [not working]

* Linting

* Add working logic to calculate the rotation degree for each frame

* Visualize effects of derotation and correct some errors

* Add draft pipeline to find centroid

* Add libraries to pyproject.toml

* Clean up

* Improve plots

* Optimization v1

* Add changes to gitignore

* Add functioning algorithm to optimize rotation degrees

* Add improvements in the optimization algorithms for centroid location and derotation angles

* Add new plotting of centroids

* Move part of the analysis code in methods in other files - analog preprocessing - extraction of rotation angles

* Update pyproject.toml

* Refactor plots and other methods

* dummy napari plotting widget

* make a napari-MPL widget

* Add functioning napari plugin

* Add dependencies

* Use unique configs and make path relative

* Big refactoring

* Remove curve fitting

* Clean up gitignore

* Move code to find best centroid

* Rename method

* Use pipeline in old script

* Add new strategy for derotation

* Small edits

* Visualize labels

* Use pilot data

* Fix imports and attributes

* Add less permissive angle

* Rename files

* Load grid data

* More workarounds to play with grid data 🥲

* Renaming functions to make them generic and add WORKING DEROTATION BY LINE 🥳

* Further refinement and changes in napari and debugging script

* Improve the algorithm for end of rotation

* Improve naming of conditions

* Remove bugs for negative rotations

* Handle rotation ticks missing better

* Add script to visualize how different params of scipy.rotate affect the image

* Handle better initialization of original image at the beginning and at the end of the rotation - no interpolation with scipy

* Choose data

* Improve plotting and image handling in script

* Add two images regarding scipy rotate params exploration

* Fix error in detection of false rotations

* Workaround for suboptimal threshold identification

* Clean up napari script

* Temporary adjustament of rotation algorithm

* Include other datasets

* Complete pipeline including masking and saving of tif file

* Renaming file

* Refactoring, move modules in different folders

* More refactoring and deletion of unused methods

* More refactoring

* More refactoring related to data in input, changes in the config files

* Add readme

* Renaming

* Change dependencies

* Add logging

* Fix small import bug and change order of rotate method

* Upadate readme

* Fix wrong log name

* Edits to the readme

* Add extra method (draft)

* Add script to saved tifs for unique rotations

* Add script to correct an artefact

* Add script to remove rotations for completed tif file

* Move script to isolate rotations

* Add other plotting scripts

* Get data retreives file name

* Plots are not saved here anymore

* Improve rotation by line and add fileter for incremental rotation

* Delete older plots

* Load data refactoring

* Load data refactoring

* Remove hard coded values

* Add improvements to analog signals processing and a test

* Add debugging plots, more logging and reformatting of checks

* Remove method with bisect

* Change method signature

* Rearrange checks logic

* Add useful counts

* Extend adjust rotation increment

* Remove obsolete method

* Add further method to correct ticks number

* Add better angle interpolation method

* Use new interpolation method

* Change order of methods

* Improve mask generation

* Read speed info as well

* Fix interpolation bugs

* Add converters

* Add more debugging plots

* Reordering methods

* Improve calculation of rotation increments

* Add typing and docstrings

* Add first working test

* Add test on correction of start and end times

* Add test for the creation of the signed rotation array

* Make drop ticks method static and create related test

* Update manifest file

* Update docstring

* Fix random seed bug

* Make adjust rotation increment static and add test

* Remove over-use of static methods, just one was useful

* Fix tick drop bug and add more tests

* Add test for angles

* Add new visualization and clean up

* Add more docs and edit config

* Add more docs

* Refactor and clean up

* Add working pipeline for incremental rotations

* Add saving of angle table, BUT there is a bug in the derotation, solution not found yet

* Add working derotation of incremental images

* Add script to identify the displacement of the frames during rotation

* Finish up script to test incremental derotation registration

* Add incremental derotation registration to the pipeline

* Allow to change diameter of circular mask

* Fix derotation by line bug

* Delete all exploration plots

* Delete napari related files

* Add typing and docstrings

* Move scripts in a dedicated folder

* Remove leftover from napari plugin

* Fix error in installation of dependencies

* Simplify derotation by line

* Add regression tests for image rotation

* Update readme file

* Expand readme

* Add generic paths to config files

* Remove not so useful comments

* Update .gitignore and MANIFEST.in

* Adapt sphinx docs and improve some docstrings

* Renaming

* Move the main method, derotate by line, out of the pipeline

* Add more examples in the readme

* Fix used dog image

* Add script to correct csv

* Move the logic to generate a better csv inside the class

* Fixed manifest

* Fix docs building bug (missing imports)

* Add script to run derotation in the cluster

* Add the dogs 🐕

* Fix image naming mistake

* Fix bug in angle interpolation

* Include contrast enhancment

* Move threshold and contrast values to config file

* Use the image offset to fill in the blank pixels

* Fix typo

* Use the same diameter for masking when doing derotations one after the other

* Fix plotting and tick estimation bugs in incremental rotation pipeline

* Add script to create plots from sample video

* Add script to merge csv and tiff files

* Add script to make mean image

* Add missing dependency

* Add script to import extracted df/f from suite2p

* Maintained the masked image in the incremental rotation object

* Add script to work on suite2p registered video

* Fix bug in incremental rotation pipeline

* wip

* wip

* Removed unused modules

* Remove contrast enhancement

* Remove contrast enhancement

* Clean up methods

* Correct error in pyproject.toml

* Override a method in incremental rotation - rotation number should be treated differently

* Linting and commenting out the method to find a circle as it is work in progress

* Add wip notebook for dashboard made with fastplotlib

* Correct method name in tests

* Delete files related to the development of other features

* Delete commented method

* Add some comments to explain the handling of number of rotations

* Delete unwanted method

* Delete repated imports

* Remove reference to "adjust increment" in the readme

* Fix int overflow bug due to older numpy version

* Remove reference to contrast enhacement from config file
  • Loading branch information
lauraporta authored Jul 26, 2024
1 parent 1820715 commit b01e5fd
Show file tree
Hide file tree
Showing 17 changed files with 106 additions and 959 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ Here's a quick rundown of the configuration parameters you'll need to adjust:

* `channel_names`: List the names of the signals in the aux_stim file.
* `rotation_increment`: Set the motor's angle increment.
* `adjust_increment`: Enable this to adjust the rotation_increment if the motor ticks don't sum to exactly 360 degrees.
* `rot_deg`: Define a full rotation degree count.
* `debugging_plots`: Toggle this to save debugging plots.
* `analog_signals_processing`: Configure parameters for analog signal processing, including peak finding and pulse processing.
Expand Down
262 changes: 0 additions & 262 deletions derotation/adjust_rotation_degrees.py

This file was deleted.

113 changes: 0 additions & 113 deletions derotation/analog_preprocessing.py

This file was deleted.

Loading

0 comments on commit b01e5fd

Please sign in to comment.