-
Notifications
You must be signed in to change notification settings - Fork 492
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ADD: Add PyRadiomics Model schema validation
Update the PyKwalify validation in PyRadiomics to also allow validation of PyRadiomics model files. Add an example model file to explain the structure. Update requirements.txt to enforce PyKwalify version != 1.6.0, as this version contains a bug that breaks the usage of partial schemas, which is utilized to allow validation of the two use cases (parameter file and model file) Because partial schemas are used, load the schemas outside of pykwalify and pass them during validation as a dict. Update the testParams script to allow testing of both use cases.
- Loading branch information
Showing
8 changed files
with
251 additions
and
140 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# This is an example of how a PyRadiomics Model looks like. | ||
# It consists of 2 main parts: "extraction" and "model" | ||
# | ||
# "extraction": this part defines the settings PyRadiomics needs to extract the required features for the input. | ||
# A model can incorporate features extracted from different images (e.g. multiple time points, or different MR | ||
# sequences). For each image, a customized extraction may be defined by providing the image name as a key, and the | ||
# customization as a value. This customization value must adhere to the same rules as a parameter file. | ||
# In addition, extraction parameters that are common to all input images can be defined under "general". Be aware, | ||
# "general" is therefore not allowed as an image name. | ||
# If an image name is provided in the model, but not included in the extraction settings, no additional customization | ||
# is applied for that image (just the general settings, if present) | ||
# | ||
# "model": this part provides all needed information to build the model. In this case, a simple linear regression model | ||
# is shown. Both the "name" key (identifying the model type) and "parameters" key (providing model specific parameters) | ||
# are required. What kind of parameters are possible/required depends on the model. In this case, only the intercept of | ||
# the model and the betas (slopes) of the included features are required. | ||
|
||
extraction: | ||
general: | ||
setting: | ||
binWidth: 25 | ||
imageType: | ||
Original: {} | ||
|
||
image1: | ||
featureClass: | ||
glcm: | ||
- Dissimilarity | ||
|
||
image2: | ||
featureClass: | ||
firstorder: | ||
- Mean | ||
|
||
model: | ||
name: linearregression | ||
parameters: | ||
intercept: 0.334 | ||
betas: | ||
image1_original_glcm_Dissimilarity: 0.1 | ||
image2_original_firstorder_Mean: 0.3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# include: customization_schema | ||
name: model_schema | ||
type: map | ||
mapping: | ||
extraction: | ||
type: map | ||
mapping: | ||
regex;(.+): | ||
include: customization_schema | ||
model: | ||
type: map | ||
required: true | ||
mapping: | ||
name: | ||
type: str | ||
required: true | ||
parameters: | ||
type: map | ||
required: true | ||
mapping: | ||
regex;(.+): | ||
type: any |
Oops, something went wrong.