-
Notifications
You must be signed in to change notification settings - Fork 498
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
Add checks for mask size and dimensions. #223
Conversation
Add function to check if ROI is large enough for computation. First checks if label is present in the mask, then checks if the number of dimensions in which the size > 1 is at least the minimum number of dimensions (default: 1). Finally an an optional check for a minimum number of voxels in the tumor region can be performed (switched off by default). This check is performed in `featureextractor` after the loading of the image and any image pre-processing steps (e.g. resampling), but before features are extracted or filters applied.
Add a check that ensures that the ROI defined in the mask occupies a physical space that is contained within the physical space of the image. If this is not the case, log an error and cancel extraction for that combination. Additionally, calculate the resampling grid using only the maskNode. This prevents unexpected behaviour of the defined resampling grid when image and mask with different geometry is used. Standardize use of quote and double quote when defining strings in PyRadiomics (use single quote to identify a string, 3 double quotes for a docstring)
Add FAQ explaining PyRadiomics behavior when using image and mask with different geometry. Additionally, add an example script, usable from the commandline, that resamples a mask to a reference image. This allows users to force a mask to the same geometry as the image, so it can be used in PyRadiomics without resampling.
@@ -74,7 +74,8 @@ def main(): | |||
|
|||
provenance = extractor.getProvenance(imagePath, maskPath, mask) | |||
|
|||
image, mask, bb = imageoperations.cropToTumorMask(image, mask) |
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 would avoid using "Tumor". Maybe "cropToMaskBoundingBox", or "cropToMaskROI".
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.
Sorry, I understand this is not related to the essence of this specific PR
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.
Sorry, I understand this is not related to the essence of this specific PR
No, it's not, but it's still a good suggestion. I am running over the documentation for errors, will update this then also.
LGTM otherwise! |
Add function to check if ROI is large enough for computation.
First checks if label is present in the mask, then checks if the number of dimensions in which the size > 1 is at least the minimum number of dimensions (default: 1). Finally an an optional check for a minimum number of voxels in the tumor region can be performed (switched off by default).
This check is performed in
featureextractor
after the loading of the image and any image pre-processing steps (e.g. resampling), but before features are extracted or filters applied.Addresses #18
cc @Radiomics/developers