-
Notifications
You must be signed in to change notification settings - Fork 2
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
Save gradient data as image #216
Conversation
…to analysis/variable_count_and_size_experiment
…lpack into analysis/variable_count_and_size_experiment
* return count as integer * allow specifying seed list in the recipe
…lpack into fix/parallel_packing_with_simularium
* add sphere mesh objects for tests * add recipe for nested mesh testing
…riable_count_and_size_experiment
* move voxelization code to environment * add voxelization function for gradient distances and weights * refactor image writer export code * add recipe and config for testing
Codecov ReportAll modified and coverable lines are covered by tests ✅
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## main #216 +/- ##
=======================================
Coverage 98.63% 98.63%
=======================================
Files 18 18
Lines 511 511
=======================================
Hits 504 504
Misses 7 7 ☔ View full report in Codecov by Sentry. |
Use |
"voxel_size": [1,1,1], | ||
"projection_axis": "z" | ||
}, | ||
"save_gradient_data_as_image": true |
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.
since this is a new config setting it should also have a default setting in the config loader.
I also think, for clarity, any settings here that are defaults should be removed. The configs are ballooning a bit
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.
Removed the default entries from the config file and added the new setting to config_loader.py
@@ -70,6 +70,9 @@ def pack(recipe, config_path=None, analysis_config_path=None): | |||
recipe_version=recipe_data["version"], | |||
image_export_options=packing_config_data.get("image_export_options"), | |||
parallel=packing_config_data.get("parallel", False), | |||
save_gradient_data_as_image=packing_config_data.get( | |||
"save_gradient_data_as_image", False | |||
), |
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.
this is starting to make me think we should just send the config into analysis instead of unpacking values here
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.
Created an issue #227 to track this
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.
looks good to me, just one request that you add the new config setting to the config loader so we don't have mystery settings
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 ran the test recipe and was able to view the image without any problems. And I'm on board with adding save_gradient_data_as_image
into config loader. Great work!
@@ -3129,50 +3129,47 @@ def applyStep(self, step): | |||
self.traj.applyState_primitive_name(self, step) | |||
# ho can we apply to parent instance the rotatiotn? | |||
|
|||
def create_voxelization(self, image_data, image_size, voxel_size, hollow=False): | |||
def create_voxelization(self, image_writer): |
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.
Good idea to trim down the parameters and make this function more flexible!
Note: Merge #215 before this PR
Problem
We want to export grid distances and weights as 3D images.
Closes #199
Solution
Used the
ImageWriter
class to export gradient distances and weights as 3D tiff images.Type of change
Change summary:
Steps to Verify:
pack -r cellpack/tests/recipes/v2/test_nested_mesh_gradient.json -c cellpack/tests/packing-configs/test_gradient_data_image.json
figures/gradient_data_figures
to view the exported image.Screenshots:
Distances (mean intensity projection):
Weights (mean intensity projection):
Keyfiles (delete if not relevant):
ImageWriter.py
Gradients.py