-
Notifications
You must be signed in to change notification settings - Fork 6
Updated curation to allow user defined cube size #133
Conversation
Preview page for your plugin is ready here: |
Codecov ReportBase: 95.42% // Head: 95.80% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main brainglobe/cellfinder#133 +/- ##
==========================================
+ Coverage 95.42% 95.80% +0.37%
==========================================
Files 17 17
Lines 808 881 +73
==========================================
+ Hits 771 844 +73
Misses 37 37
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
cellfinder_napari/utils.py
Outdated
spinbox.setMaximumWidth = width | ||
if label == "Cube Depth": | ||
spinbox.setValue(20) | ||
spinbox.setRange(1, 20) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason the depth can't go above 20?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll go ahead and just set a minimum value
cellfinder_napari/utils.py
Outdated
spinbox.setRange(1, 20) | ||
else: | ||
spinbox.setValue(50) | ||
spinbox.setRange(1, 50) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment as above. Theoretically, someone could have v. high resolution data (or huge objects to detect) and might need bigger cuboids.
Thanks for raising this PR @MysticElephant!
Considering this PR relies on changes to
Thanks for checking this. However before merging, automated tests for these new features will need to be added. This can just be to check that the GUI is functioning properly (the actual cube extraction can be tested in |
How do I add automatic automatic testing to my project? I saw something with pytest and I thought I ran that before submitting this pull request. Am I missing something? |
Yes so we run tests with pytest. These tests can be found in cellfinder-napari/cellfinder-napari/tests. This basically a collection of scripts that run some part of the code and check that what should happen, happens. Running Not sure if this make sense? Testing is quite a large topic in itself. |
Hello. I understand the whole testing process now and have added the changes from utils.py to testing. Right now, I am struggling to write the code for testing the changes in curation and was wondering if you would be able to guide me. |
Could you push the changes you've already made so I can take a look? I'm a bit busy at the moment, the best way to get a sense of how to test these things is probably to take a look at the other tests in |
I just pushed changes for test_utils.py and also increased the range to 1,000,000 for cube size. I was trying to see if there was a way to set positive infinity as the max value but I couldn't seem to get it to work. Would 1,000,000 be sufficient for max value? Also, what would be the best way to implement using the shape for building the new model? I was thinking of adding 3 new arguments flags to train_yml.py so the user could specify but if there is another way that would be better, please let me know. |
Yep that should be fine. Thanks.
That sounds about right. I guess the shape could be inferred by reading in a single cuboid, but I'm not sure if it's better to pass in the shape explicitly. |
I'll go ahead and proceed with passing the shape explicitly. Also, were you able to take a look at the additions to curation.py to see how that could be tested using PyTest? Also, I am getting this error while trying to do pip install -e .[dev] on cellfinder-core package
note: This error originates from a subprocess, and is likely not a problem with pip. |
This seems to be a common issue, but I haven't been able to reproduce with |
I haven't had chance to go through in much detail, but what I would check is:
|
I am using Windows 10 version 21H2 and setuptools version 65.0.2 |
@MysticElephant I'm not sure if this will fix it for you, but on a new Windows 10 machine, I got this up and running by updating |
Installing Build Tools worked. now i have the dev build for cellfinder-core. |
Kudos, SonarCloud Quality Gate passed! |
Now I'm moving onto cellfinder-core and whenever i try to run cellfinder_train in the environment using the --continue-train flag, it gives me this error
I did pip install -e .[dev] on cellfinder-core btw |
This looks like an issue on your local machine, that you don't have access to that directory. Can you run as administrator? |
I ran as administrator and it's still giving me the same error. Just as an FYI, I do have another environment with a non dev version of cellfinder installed. |
That sounds like a good idea. Unfortunately I don't have much time atm to debug development installation issues.
I would just install dev builds of the software you want to work on. Both |
The error I get now is:
I reinstalled everything in a new environment and it happens whenever i run cellfinder_train with the --continue-training flag |
I'm afraid I don't know the answer to that one. Could you try a different Python version? |
Hi @MysticElephant. Is there anything we can do help with this feature? If you don't have the time currently, we can close the PR, but feel free to re-open later on. |
Before submitting a pull request (PR), please read the contributing guide.
Description
Updated the napari plugin of cellfinder to allow user to redefine cube size and save it with the new cube sizes. The second commit should've been named "Fixed formatting issues".
What is this PR
This is an addition of a feature.
Why is this PR needed?
Currently the program only allows a specific cube size to be used for training and classification and this is the first step to allow user defined cube sizes with cellfinder. I will work on cellfinder-core and when ready, will submit a pull request in that repository.
References
#211 from cellfinder repository
How has this PR been tested?
I tested to make sure napari accepts the new value for cube size and that the saved files are saved with the correct shape. In addition, based on the cellfinder documentation for cellfinder, the cube size can only be even values and will show in the conda terminal and napari if an odd value is input and reset back to the default values.
Does this PR require an update to the documentation?
No documentation updates are needed as of yet. When full feature is released, documentation will need to be updated.
Checklist: