Skip to content
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

Create testing dataset #2

Merged
merged 19 commits into from
Aug 7, 2020
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
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,13 @@
# data-testing
Light-weighted data for testing/tutorial

# Content
* sub-unf01: BIDS folder with multiple contrast (T2w, T2star and T1w). Original image and derivatives (see below) from [ivadomed spine generic example repo](https://github.com/ivadomed/data_example_spinegeneric/releases/tag/r20200907) were resampled to 1mm isotropic and converted to Float32 to reduce repo size. Subject was randomly selected among the available subjects. Images were oriented according to RPI convention and were cropped with the following bounding box: x=[50, 181], y=[60, 201], z=[10, 26].
* `derivatives/labels/sub-unf01`: derivatives folder with the following labels:
* `_seg-manual`: spinal cord segmentations for all contrasts,
* `_lesion-manual`: dummy labels which are supposed to represent lesion segmentation. WARNING: these are *not* actual lesion segmentations, but are only here for the purpose of testing the workflow of `ivadomed` codebase.
* `_labels-disc-manual`: dummy label (single voxel), which is supposed to represent disc label. WARNING: this is *not* an actual label that represent the anatomy, but is only here for the purpose of testing the workflow of `ivadomed` codebase.
* bounding\_box.json: dictionary to test a specific function from `ivadomed/scripts/bounding_box.py`.
* dataset\_description.json: this file is needed to described the dataset.
* participants.csv: table with subject name and potential metadata.
* temporary\_results.csv: Used to test `ivadomed/scripts/compare_models.py`.
21 changes: 21 additions & 0 deletions bounding_box_dict.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"testing_data/sub-unf01/anat/sub-unf01_T1w.nii.gz":
[
7,
386,
113,
231,
1,
16
],

"testing_data/sub-unf01/anat/sub-unf01_T2w.nii.gz":
[
7,
386,
113,
231,
1,
16
]
}
7 changes: 7 additions & 0 deletions dataset_description.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"BIDSVersion": "1.0.1",
"Name": "Spine_generic_example",
"Researcher": "Julien Cohen-Adad",
"Study": "https://spine-generic.readthedocs.io/",
"Version": "https://github.com/spine-generic/data-multi-subject/archive/r20200722.zip"
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
Binary file not shown.
Binary file not shown.
Binary file not shown.
5 changes: 5 additions & 0 deletions hyperparameter_opt.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"training_parameters": {
"batch_size": [2, 4]
}
}
135 changes: 135 additions & 0 deletions model_config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
{
"command": "train",
"gpu": 7,
"log_directory": "testing_script",
"debugging": false,
"model_name": "unit_test",
"object_detection_params": {
"object_detection_path": null
},
"loader_parameters": {
"target_suffix": ["_lesion-manual"],
"roi_suffix": null,
"bids_path": "testing_data/",
"roi_params": {
"suffix": null,
"slice_filter_roi": null
},
"contrast_params": {
"random_seed": 1313,
"training_validation": [
"T2w"
],
"balance": {},
"testing": [
"T2w"
],
"center_test": []
},
"slice_filter_params": {
"filter_empty_mask": false,
"filter_empty_input": true
},
"slice_axis": "axial",
"split_method": "per_patient",
"multichannel": false,
"soft_input": false
},
"split_dataset": {
"fname_split": null,
"random_seed": 1313,
"method": "per_patient",
"train_fraction": 0.66,
"test_fraction": 0.33,
"center_test": []
},
"training_parameters": {
"batch_size": 32,
"loss": {
"name": "DiceLoss"
},
"training_time": {
"num_epochs": 1,
"early_stopping_patience": 50,
"early_stopping_epsilon": 0.001
},
"scheduler": {
"initial_lr": 0.001,
"lr_scheduler": {
"name": "CosineAnnealingLR",
"base_lr": 1e-5,
"max_lr": 1e-2
}
},
"balance_samples": false,
"mixup_alpha": null,
"transfer_learning": {
"retrain_model": null,
"retrain_fraction": 1.0
}
},
"default_model": {
"name": "Unet",
"dropout_rate": 0.3,
"bn_momentum": 0.1,
"out_channel": 1,
"depth": 1
},
"FiLMedUnet": {
"applied": false,
"metadata": "contrasts",
"film_layers": [0, 1, 0, 0, 0, 0, 0, 0, 0, 0]
},
"missing_modality": false,
"attention_unet": false,
"mixup_bool": false,
"metadata": null,
"testing_parameters": {
"binarize_prediction": false,
"uncertainty": {
"epistemic": true,
"aleatoric": true,
"n_it": 2
}
},
"evaluation_parameters": {
"targetSize": {
"unit": "vox",
"thr": [
20,
100
]
},
"removeSmall": {
"unit": "vox",
"thr": 3
},
"overlap": {
"unit": "vox",
"thr": 3
}
},
"transformation": {
"Resample": {
"wspace": 0.75,
"hspace": 0.75
},
"ElasticTransform": {
"alpha_range": [28.0, 30.0],
"sigma_range": [3.5, 4.5],
"p": 0.1
},
"RandomAffine": {
"degrees": 4.6,
"translate": [0.03, 0.03],
"scale": [0.98, 1]
},
"CenterCrop":{
"size": [128, 128],
"preprocessing": true},
"NumpyToTensor": {},
"NormalizeInstance": {
"applied_to": ["im"]
}
}
}
122 changes: 122 additions & 0 deletions model_config_test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
{
"command": "test",
"gpu": 0,
"log_directory": "testing_script",
"debugging": false,
"model_name": "model_unet_test",
"object_detection_params": {
"object_detection_path": null
},
"loader_parameters": {
"target_suffix": ["_lesion-manual"],
"roi_suffix": null,
"bids_path": "testing_data/",
"roi_params": {
"suffix": null,
"slice_filter_roi": null
},
"contrast_params": {
"random_seed": 1313,
"training_validation": [
"T2w"
],
"balance": {},
"testing": [
"T2w"
],
"center_test": []
},
"slice_filter_params": {
"filter_empty_mask": false,
"filter_empty_input": true
},
"slice_axis": "axial",
"split_method": "per_patient",
"multichannel": false,
"soft_input": false
},
"split_dataset": {
"fname_split": null,
"random_seed": 1313,
"method": "per_patient",
"train_fraction": 0.66,
"test_fraction": 0.33,
"center_test": []
},
"training_parameters": {
"batch_size": 32,
"loss": {
"name": "DiceLoss"
},
"training_time": {
"num_epochs": 1,
"early_stopping_patience": 50,
"early_stopping_epsilon": 0.001
},
"scheduler": {
"initial_lr": 0.001,
"lr_scheduler": {
"name": "CosineAnnealingLR",
"base_lr": 1e-5,
"max_lr": 1e-2
}
},
"balance_samples": false,
"mixup_alpha": null,
"transfer_learning": {
"retrain_model": null,
"retrain_fraction": 1.0
}
},
"default_model": {
"name": "Unet",
"dropout_rate": 0.3,
"bn_momentum": 0.1,
"out_channel": 1,
"depth": 1
},
"FiLMedUnet": {
"applied": false,
"metadata": "contrasts",
"film_layers": [0, 1, 0, 0, 0, 0, 0, 0, 0, 0]
},
"missing_modality": false,
"attention_unet": false,
"mixup_bool": false,
"metadata": null,
"testing_parameters": {
"binarize_prediction": true,
"uncertainty": {
"epistemic": true,
"aleatoric": true,
"n_it": 2
}
},
"evaluation_parameters": {
"targetSize": {
"unit": "vox",
"thr": [
20,
100
]
},
"removeSmall": {
"unit": "vox",
"thr": 3
},
"overlap": {
"unit": "vox",
"thr": 3
}
},
"transformation": {
"Resample": {
"wspace": 0.75,
"hspace": 0.75
},
"NumpyToTensor": {},
"NormalizeInstance": {
"applied_to": ["im"]
}
}
}
2 changes: 2 additions & 0 deletions participants.tsv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
participant_id sex age first_name last_name date_of_birth date_of_scan pathology data_id institution_id
sub-unf01 unknown - unknown unknown - unknwon unknwon unknown unknown
64 changes: 64 additions & 0 deletions sub-unf01/anat/sub-unf01_T1w.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
{
"Modality": "MR",
"MagneticFieldStrength": 3,
"Manufacturer": "Siemens",
"ManufacturersModelName": "Prisma_fit",
"InstitutionName": "IUGM",
"InstitutionAddress": "Chemin_Queen-Mary_4565_Montreal_District_CA_H3W_1W5",
"DeviceSerialNumber": "167006",
"StationName": "MRC35049",
"BodyPartExamined": "SPINE",
"PatientPosition": "HFS",
"ProcedureStepDescription": "spine_generic",
"SoftwareVersions": "syngo_MR_E11",
"MRAcquisitionType": "3D",
"SeriesDescription": "T1w",
"ProtocolName": "T1w",
"ScanningSequence": "GR_IR",
"SequenceVariant": "SK_SP_MP",
"ScanOptions": "IR",
"SequenceName": "_tfl3d1_16",
"ImageType": ["ORIGINAL", "PRIMARY", "M", "NORM", "DIS3D", "DIS2D"],
"SeriesNumber": 2,
"AcquisitionTime": "12:33:7.032500",
"AcquisitionNumber": 1,
"SliceThickness": 1,
"SAR": 0.0601922,
"EchoTime": 0.00372,
"RepetitionTime": 2,
"InversionTime": 1,
"FlipAngle": 9,
"PartialFourier": 1,
"BaseResolution": 320,
"ShimSetting": [
620,
-7194,
-9127,
77,
28,
-20,
-10,
-23 ],
"TxRefAmp": 266.247,
"PhaseResolution": 1,
"ReceiveCoilName": "HeadNeck_64",
"ReceiveCoilActiveElements": "HC1-7;NC1,2",
"PulseSequenceDetails": "%SiemensSeq%_tfl",
"ConsistencyInfo": "N4_VE11C_LATEST_20160120",
"PercentPhaseFOV": 81.25,
"PhaseEncodingSteps": 259,
"AcquisitionMatrixPE": 260,
"ReconMatrixPE": 320,
"ParallelReductionFactorInPlane": 2,
"PixelBandwidth": 150,
"ImageOrientationPatientDICOM": [
0,
1,
0,
-0.00523601,
0,
-0.999986 ],
"InPlanePhaseEncodingDirectionDICOM": "ROW",
"ConversionSoftware": "dcm2niix",
"ConversionSoftwareVersion": "v1.0.20180622 (JP2:OpenJPEG) GCC6.1.0"
}
Binary file added sub-unf01/anat/sub-unf01_T1w.nii.gz
Binary file not shown.
Loading