Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,28 @@ The three transformations are:

## Contributing

Please use the following angular commit message format:
```
<type>(optional scope): short summary in present tense

(optional body: explains motivation for the change)

(optional footer: note BREAKING CHANGES here, and issues to be closed)

```
`<type>` refers to the kind of change made and is usually one of:

- `feat`: A new feature.
- `fix`: A bug fix.
- `docs`: Documentation changes.
- `style`: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc).
- `refactor`: A code change that neither fixes a bug nor adds a feature.
- `perf`: A code change that improves performance.
- `test`: Changes to the test framework.
- `build`: Changes to the build process or tools.

`scope` is an optional keyword that provides context for where the change was made. It can be anything relevant to your package or development workflow (e.g., it could be the module or function - name affected by the change).

Interested in contributing? Check out the contributing guidelines. Please note that this project is released with a Code of Conduct. By contributing to this project, you agree to abide by its terms.

## License
Expand Down
39 changes: 22 additions & 17 deletions src/readii/feature_extraction.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,27 +93,32 @@ def singleRadiomicFeatureExtraction(
if negativeControl != None:
logger.info(f"Generating {negativeControl} negative control for CT.")
# Split negative control type into negative control and region of interest
if "non_roi" in negativeControl:
negativeControlType = negativeControl.rsplit("_", 2)[0]
negativeControlRegion = "non_roi"
else:
negativeControlComponents = negativeControl.rsplit("_", 1)
negativeControlType = negativeControlComponents[0]
negativeControlRegion = negativeControlComponents[1]
logger.debug(f"Negative control region: {negativeControlRegion}")
logger.debug(f"Negative control type: {negativeControlType}")
# Make negative control version of ctImage
ctImage_nc: sitk.Image | np.ndarray = applyNegativeControl(
baseImage=ctImage,
negativeControlType=negativeControlType,
negativeControlRegion=negativeControlRegion,
roiMask=alignedROIImage,
randomSeed=randomSeed
)
try:
if "non_roi" in negativeControl:
negativeControlType = negativeControl.rsplit("_", 2)[0]
negativeControlRegion = "non_roi"
else:
negativeControlComponents = negativeControl.rsplit("_", 1)
negativeControlType = negativeControlComponents[0]
negativeControlRegion = negativeControlComponents[1]
logger.debug(f"Negative control region: {negativeControlRegion}")
logger.debug(f"Negative control type: {negativeControlType}")
# Make negative control version of ctImage
ctImage_nc: sitk.Image | np.ndarray = applyNegativeControl(
baseImage=ctImage,
negativeControlType=negativeControlType,
negativeControlRegion=negativeControlRegion,
roiMask=alignedROIImage,
randomSeed=randomSeed
)
except Exception as e:
logger.error(f"Error generating {negativeControl} negative control for CT: {e}")

croppedCT, croppedROI = imageoperations.cropToTumorMask(ctImage_nc, alignedROIImage, segBoundingBox)
else:
# Crop the image and mask to a bounding box around the mask to reduce volume size to process
croppedCT, croppedROI = imageoperations.cropToTumorMask(ctImage, alignedROIImage, segBoundingBox)


# Load PyRadiomics feature extraction parameters to use
# Initialize feature extractor with parameters
Expand Down
Loading