Skip to content

Commit

Permalink
feat: add abstract and concrete classes for negative controls and reg…
Browse files Browse the repository at this point in the history
…ions (#81)

# 4D-Lung

![combined](https://github.com/user-attachments/assets/17d071d5-5738-4b08-ac72-d0a7b46e254a)

# Order of operations

1. `negative_control_strategy(image, mask=mask, region=region_strategy)`
2. runs the `__call__` on the `negative_control_strategy` 
3. which runs the `__call__` of `region(image_array, mask_array)`
4. the result of which is used to figure out what indices of the
original image to apply the `transform` method of the
`NegativeControlStrategy` concrete classes to
5. only replace the region indices `image_array[mask_indices] =
transformed_values`


Resource on Strategy Pattern:
https://refactoring.guru/design-patterns/strategy/python/example

---------

Co-authored-by: Katy Scott <[email protected]>
  • Loading branch information
jjjermiah and strixy16 authored Dec 11, 2024
1 parent 3bcaa28 commit c10a568
Show file tree
Hide file tree
Showing 13 changed files with 1,630 additions and 287 deletions.
3 changes: 2 additions & 1 deletion config/ruff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ cache-dir = "~/.cache/ruff"
# iteratively adding files to the include list
include = [
"src/readii/loaders.py",
"src/readii/feature_extraction.py"
"src/readii/feature_extraction.py",
"src/readii/negative_controls_refactor/**.py",
]

# extend-exclude is used to exclude directories from the flake8 checks
Expand Down
375 changes: 375 additions & 0 deletions notebooks/viz_neg_4D.ipynb

Large diffs are not rendered by default.

404 changes: 404 additions & 0 deletions notebooks/viz_neg_controls.ipynb

Large diffs are not rendered by default.

49 changes: 0 additions & 49 deletions old_pyproject.toml

This file was deleted.

Loading

0 comments on commit c10a568

Please sign in to comment.