From f9f492145e0fb67cf8f86e0898b83b8432d24ac3 Mon Sep 17 00:00:00 2001 From: sarthakpati Date: Mon, 24 Oct 2022 11:31:27 -0400 Subject: [PATCH 01/13] common copyright message --- GANDLF/cli/__init__.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/GANDLF/cli/__init__.py b/GANDLF/cli/__init__.py index c2b21e87e..28350a300 100644 --- a/GANDLF/cli/__init__.py +++ b/GANDLF/cli/__init__.py @@ -1,3 +1,12 @@ from .patch_extraction import patch_extraction from .main_run import main_run from .preprocess_and_save import preprocess_and_save + +from datetime import date + +copyrightMessage = ( + "Contact: gandlf@cbica.upenn.edu\n\n" + + "This program is NOT FDA/CE approved and NOT intended for clinical use.\nCopyright (c) " + + str(date.today().year) + + " MLCommons. All rights reserved.\n\nCitation: https://arxiv.org/abs/2103.01006" +) From ad4194a0ba861504923b8396b7d8e3fd1d514b5b Mon Sep 17 00:00:00 2001 From: sarthakpati Date: Mon, 24 Oct 2022 11:31:43 -0400 Subject: [PATCH 02/13] using common copyright message --- gandlf_anonymizer | 9 +-------- gandlf_collectStats | 13 +------------ gandlf_constructCSV | 9 ++------- gandlf_patchMiner | 12 +++--------- gandlf_preprocess | 10 +--------- gandlf_run | 10 +--------- gandlf_verifyInstall | 10 ++-------- 7 files changed, 11 insertions(+), 62 deletions(-) diff --git a/gandlf_anonymizer b/gandlf_anonymizer index 5736b5251..21da6d6f6 100644 --- a/gandlf_anonymizer +++ b/gandlf_anonymizer @@ -2,18 +2,11 @@ # -*- coding: utf-8 -*- import os, argparse, sys, yaml -from datetime import date from GANDLF.anonymize import run_anonymizer +from GANDLF.cli import copyrightMessage def main(): - copyrightMessage = ( - "Contact: software@cbica.upenn.edu\n\n" - + "This program is NOT FDA/CE approved and NOT intended for clinical use.\nCopyright (c) " - + str(date.today().year) - + " University of Pennsylvania. All rights reserved." - ) - parser = argparse.ArgumentParser( prog="GANDLF_Anonymize", formatter_class=argparse.RawTextHelpFormatter, diff --git a/gandlf_collectStats b/gandlf_collectStats index 32210234d..f8d03b4d1 100644 --- a/gandlf_collectStats +++ b/gandlf_collectStats @@ -2,29 +2,18 @@ # -*- coding: utf-8 -*- import os -import sys import argparse -import subprocess -import pathlib import ast from pathlib import Path -from datetime import date -import numpy as np import pandas as pd from io import StringIO import seaborn as sns import matplotlib.pyplot as plt +from GANDLF.cli import copyrightMessage def main(): - copyrightMessage = ( - "Contact: software@cbica.upenn.edu\n\n" - + "This program is NOT FDA/CE approved and NOT intended for clinical use.\nCopyright (c) " - + str(date.today().year) - + " University of Pennsylvania. All rights reserved." - ) - parser = argparse.ArgumentParser( prog="GANDLF_CollectStats", formatter_class=argparse.RawTextHelpFormatter, diff --git a/gandlf_constructCSV b/gandlf_constructCSV index 8bf754555..cb9f67c2d 100644 --- a/gandlf_constructCSV +++ b/gandlf_constructCSV @@ -5,15 +5,10 @@ import os, argparse, sys from datetime import date from GANDLF.utils import writeTrainingCSV +from GANDLF.cli import copyrightMessage -def main(): - copyrightMessage = ( - "Contact: software@cbica.upenn.edu\n\n" - + "This program is NOT FDA/CE approved and NOT intended for clinical use.\nCopyright (c) " - + str(date.today().year) - + " University of Pennsylvania. All rights reserved." - ) +def main(): parser = argparse.ArgumentParser( prog="GANDLF_ConstructCSV", formatter_class=argparse.RawTextHelpFormatter, diff --git a/gandlf_patchMiner b/gandlf_patchMiner index 5d11f4df5..2cf3bf031 100644 --- a/gandlf_patchMiner +++ b/gandlf_patchMiner @@ -1,19 +1,13 @@ #!usr/bin/env python # -*- coding: utf-8 -*- -import os, argparse -from datetime import date +import argparse from GANDLF.cli.patch_extraction import patch_extraction +from GANDLF.cli import copyrightMessage -if __name__ == "__main__": - copyrightMessage = ( - "Contact: software@cbica.upenn.edu\n\n" - + "This program is NOT FDA/CE approved and NOT intended for clinical use.\nCopyright (c) " - + str(date.today().year) - + " University of Pennsylvania. All rights reserved." - ) +if __name__ == "__main__": parser = argparse.ArgumentParser( prog="GANDLF_PatchMiner", formatter_class=argparse.RawTextHelpFormatter, diff --git a/gandlf_preprocess b/gandlf_preprocess index 0ed698127..39cee20b3 100644 --- a/gandlf_preprocess +++ b/gandlf_preprocess @@ -2,19 +2,11 @@ # -*- coding: utf-8 -*- import argparse -from datetime import date -from GANDLF.cli import preprocess_and_save +from GANDLF.cli import preprocess_and_save, copyrightMessage # main function if __name__ == "__main__": - copyrightMessage = ( - "Contact: software@cbica.upenn.edu\n\n" - + "This program is NOT FDA/CE approved and NOT intended for clinical use.\nCopyright (c) " - + str(date.today().year) - + " University of Pennsylvania. All rights reserved." - ) - parser = argparse.ArgumentParser( prog="GANDLF_Preprocess", formatter_class=argparse.RawTextHelpFormatter, diff --git a/gandlf_run b/gandlf_run index 9ea9dfa64..64f73d9bc 100644 --- a/gandlf_run +++ b/gandlf_run @@ -4,19 +4,11 @@ from __future__ import print_function, division import os, argparse, ast, sys -from datetime import date - from GANDLF import version -from GANDLF.cli import main_run +from GANDLF.cli import main_run, copyrightMessage if __name__ == "__main__": - copyrightMessage = ( - "Contact: gandlf@cbica.upenn.edu\n\n" - + "This program is NOT FDA/CE approved and NOT intended for clinical use.\nCopyright (c) " - + str(date.today().year) - + " University of Pennsylvania. All rights reserved.\n\nCitation: https://arxiv.org/abs/2103.01006" - ) parser = argparse.ArgumentParser( prog="GANDLF", formatter_class=argparse.RawTextHelpFormatter, diff --git a/gandlf_verifyInstall b/gandlf_verifyInstall index b18583325..60edee31b 100644 --- a/gandlf_verifyInstall +++ b/gandlf_verifyInstall @@ -2,18 +2,12 @@ # -*- coding: utf-8 -*- import os, argparse -from datetime import date + +from GANDLF.cli import copyrightMessage # main function if __name__ == "__main__": - copyrightMessage = ( - "Contact: software@cbica.upenn.edu\n\n" - + "This program is NOT FDA/CE approved and NOT intended for clinical use.\nCopyright (c) " - + str(date.today().year) - + " University of Pennsylvania. All rights reserved." - ) - parser = argparse.ArgumentParser( prog="GANDLF_VerifyInstall", formatter_class=argparse.RawTextHelpFormatter, From 903f3d074bdb34131e00b45d5121f54544337b23 Mon Sep 17 00:00:00 2001 From: sarthakpati Date: Mon, 24 Oct 2022 11:35:34 -0400 Subject: [PATCH 03/13] links updated in documentation --- docs/acknowledgements.md | 2 +- docs/extending.md | 50 ++++++++++++++++++++-------------------- docs/faq.md | 14 +++++------ docs/index.md | 2 +- docs/setup.md | 2 +- docs/usage.md | 20 ++++++++-------- 6 files changed, 45 insertions(+), 45 deletions(-) diff --git a/docs/acknowledgements.md b/docs/acknowledgements.md index 9486d1cd3..d87716b79 100644 --- a/docs/acknowledgements.md +++ b/docs/acknowledgements.md @@ -27,7 +27,7 @@ This file records the following pieces of information: ## People -- [All coders and developers of GaNDLF](https://github.com/CBICA/GaNDLF/graphs/contributors) +- [All coders and developers of GaNDLF](https://github.com/mlcommons/GaNDLF/graphs/contributors) - Supervisors: - [Aimilia Gastounioti](https://www.med.upenn.edu/cbica/sbia/aimiliag.html) diff --git a/docs/extending.md b/docs/extending.md index 3f894c90d..a6f92f271 100644 --- a/docs/extending.md +++ b/docs/extending.md @@ -1,4 +1,4 @@ -For any new feature, please ensure the corresponding option in the [sample configuration](https://github.com/CBICA/GaNDLF/blob/master/samples/sample_training.yaml) is added, so that others can review/use/extend it as needed. +For any new feature, please ensure the corresponding option in the [sample configuration](https://github.com/mlcommons/GaNDLF/blob/master/samples/sample_training.yaml) is added, so that others can review/use/extend it as needed. ## Table of Contents - [Table of Contents](#table-of-contents) @@ -20,7 +20,7 @@ Before starting to work on the code-level on GaNDLF, please get the environment **NOTE**: Windows users, please ensure sure you have [Microsoft Visual C++ 14.0 or greater](http://visualstudio.microsoft.com/visual-cpp-build-tools) installed. ```bash -git clone https://github.com/CBICA/GaNDLF.git +git clone https://github.com/mlcommons/GaNDLF.git cd GaNDLF conda create -p ./venv python=3.6 -y conda activate ./venv @@ -34,76 +34,76 @@ pip install -e . ## Overall Architecture -- Command-line parsing: [gandlf_run](https://github.com/CBICA/GaNDLF/blob/master/gandlf_run) -- Parameters from [training configuration](https://github.com/CBICA/GaNDLF/blob/master/samples/config_all_options.yaml) get passed as a `dict` via [parameter parser](https://github.com/CBICA/GaNDLF/blob/master/GANDLF/parseConfig.py) -- [Training Manager](https://github.com/CBICA/GaNDLF/blob/master/GANDLF/training_manager.py): +- Command-line parsing: [gandlf_run](https://github.com/mlcommons/GaNDLF/blob/master/gandlf_run) +- Parameters from [training configuration](https://github.com/mlcommons/GaNDLF/blob/master/samples/config_all_options.yaml) get passed as a `dict` via [parameter parser](https://github.com/mlcommons/GaNDLF/blob/master/GANDLF/parseConfig.py) +- [Training Manager](https://github.com/mlcommons/GaNDLF/blob/master/GANDLF/training_manager.py): - Handles k-fold training - Main entry point from CLI -- [Training Function](https://github.com/CBICA/GaNDLF/blob/master/GANDLF/compute/training_loop.py): +- [Training Function](https://github.com/mlcommons/GaNDLF/blob/master/GANDLF/compute/training_loop.py): - Performs actual training -- [Inference Manager](https://github.com/CBICA/GaNDLF/blob/master/GANDLF/inference_manager.py): +- [Inference Manager](https://github.com/mlcommons/GaNDLF/blob/master/GANDLF/inference_manager.py): - Handles inference functionality - Main entry point from CLI -- [Inference Function](https://github.com/CBICA/GaNDLF/blob/master/GANDLF/compute/inference_loop.py): +- [Inference Function](https://github.com/mlcommons/GaNDLF/blob/master/GANDLF/compute/inference_loop.py): - Performs actual inference [Back To Top ↑](#table-of-contents) ## Dependency Management -To update/change/add a dependency in [setup](https://github.com/CBICA/GaNDLF/blob/master/setup.py), please ensure **at least** the following conditions are met: +To update/change/add a dependency in [setup](https://github.com/mlcommons/GaNDLF/blob/master/setup.py), please ensure **at least** the following conditions are met: - The package is being [actively maintained](https://opensource.com/life/14/1/evaluate-sustainability-open-source-project). -- The new dependency is being testing against the **minimum python version** supported by GaNDLF (see the `python_requires` variable in [setup](https://github.com/CBICA/GaNDLF/blob/master/setup.py)). +- The new dependency is being testing against the **minimum python version** supported by GaNDLF (see the `python_requires` variable in [setup](https://github.com/mlcommons/GaNDLF/blob/master/setup.py)). - It does not clash with any existing dependencies. ## Adding Models -- For details, please see [README for `GANDLF.models` submodule](https://github.com/CBICA/GaNDLF/blob/master/GANDLF/models/Readme.md). +- For details, please see [README for `GANDLF.models` submodule](https://github.com/mlcommons/GaNDLF/blob/master/GANDLF/models/Readme.md). - [Update Tests](#update-tests) [Back To Top ↑](#table-of-contents) ## Adding Augmentation Transformations -- Update or add dependency in [setup](https://github.com/CBICA/GaNDLF/blob/master/setup.py), if appropriate. -- Add transformation to `global_augs_dict`, defined in [`GANDLF/data/augmentation/__init__.py`](https://github.com/CBICA/GaNDLF/blob/master/GANDLF/data/augmentation/__init__.py) -- Ensure probability is used as input; probability is not used for any [preprocessing operations](https://github.com/CBICA/GaNDLF/tree/master/GANDLF/data/preprocessing) -- For details, please see [README for `GANDLF.data.augmentation` submodule](https://github.com/CBICA/GaNDLF/blob/master/GANDLF/data/augmentation/README.md). +- Update or add dependency in [setup](https://github.com/mlcommons/GaNDLF/blob/master/setup.py), if appropriate. +- Add transformation to `global_augs_dict`, defined in [`GANDLF/data/augmentation/__init__.py`](https://github.com/mlcommons/GaNDLF/blob/master/GANDLF/data/augmentation/__init__.py) +- Ensure probability is used as input; probability is not used for any [preprocessing operations](https://github.com/mlcommons/GaNDLF/tree/master/GANDLF/data/preprocessing) +- For details, please see [README for `GANDLF.data.augmentation` submodule](https://github.com/mlcommons/GaNDLF/blob/master/GANDLF/data/augmentation/README.md). - [Update Tests](#update-tests) [Back To Top ↑](#table-of-contents) ## Adding Preprocessing functionality -- Update or add dependency in [setup](https://github.com/CBICA/GaNDLF/blob/master/setup.py), if appropriate; see section on [Dependency Management](#dependency-management) for details. -- All transforms should be defined by inheriting from `torchio.transforms.intensity_transform.IntensityTransform`. For example, please see the threshold/clip functionality in the [`GANDLF/data/preprocessing/threshold_and_clip.py`](https://github.com/CBICA/GaNDLF/blob/master/GANDLF/data/preprocessing/threshold_and_clip.py) file. +- Update or add dependency in [setup](https://github.com/mlcommons/GaNDLF/blob/master/setup.py), if appropriate; see section on [Dependency Management](#dependency-management) for details. +- All transforms should be defined by inheriting from `torchio.transforms.intensity_transform.IntensityTransform`. For example, please see the threshold/clip functionality in the [`GANDLF/data/preprocessing/threshold_and_clip.py`](https://github.com/mlcommons/GaNDLF/blob/master/GANDLF/data/preprocessing/threshold_and_clip.py) file. - Define each option in the configuration file under the correct key (again, see threshold/clip as examples) -- Add transformation to `global_preprocessing_dict`, defined in [`GANDLF/data/preprocessing/__init__.py`](https://github.com/CBICA/GaNDLF/blob/master/GANDLF/data/preprocessing/__init__.py) -- For details, please see [README for `GANDLF.data.preprocessing` submodule](https://github.com/CBICA/GaNDLF/blob/master/GANDLF/data/preprocessing/README.md). +- Add transformation to `global_preprocessing_dict`, defined in [`GANDLF/data/preprocessing/__init__.py`](https://github.com/mlcommons/GaNDLF/blob/master/GANDLF/data/preprocessing/__init__.py) +- For details, please see [README for `GANDLF.data.preprocessing` submodule](https://github.com/mlcommons/GaNDLF/blob/master/GANDLF/data/preprocessing/README.md). - [Update Tests](#update-tests) [Back To Top ↑](#table-of-contents) ## Adding Training Functionality -- Update [Training Function](https://github.com/CBICA/GaNDLF/blob/master/GANDLF/compute/training_loop.py) -- Update [Training Manager](https://github.com/CBICA/GaNDLF/blob/master/GANDLF/training_manager.py), if any training API has changed +- Update [Training Function](https://github.com/mlcommons/GaNDLF/blob/master/GANDLF/compute/training_loop.py) +- Update [Training Manager](https://github.com/mlcommons/GaNDLF/blob/master/GANDLF/training_manager.py), if any training API has changed - [Update Tests](#update-tests) [Back To Top ↑](#table-of-contents) ## Adding Inference Functionality -- Update [Inference Function](https://github.com/CBICA/GaNDLF/blob/master/GANDLF/compute/inference_loop.py) -- Update [Inference Manager](https://github.com/CBICA/GaNDLF/blob/master/GANDLF/inference_manager.py), if any inference API has changed +- Update [Inference Function](https://github.com/mlcommons/GaNDLF/blob/master/GANDLF/compute/inference_loop.py) +- Update [Inference Manager](https://github.com/mlcommons/GaNDLF/blob/master/GANDLF/inference_manager.py), if any inference API has changed - [Update Tests](#update-tests) [Back To Top ↑](#table-of-contents) ## Update Tests -Once you have made changes to functionality, it is imperative that the unit tests be updated to cover the new code. Please see the [full testing suite](https://github.com/CBICA/GaNDLF/blob/master/testing/test_full.py) for details and examples. +Once you have made changes to functionality, it is imperative that the unit tests be updated to cover the new code. Please see the [full testing suite](https://github.com/mlcommons/GaNDLF/blob/master/testing/test_full.py) for details and examples. [Back To Top ↑](#table-of-contents) @@ -114,7 +114,7 @@ Once you have the virtual environment set up, tests can be run using the followi pytest --device cuda # can be cuda or cpu, defaults to cpu ``` -Any failures will be reported in the file [`${GaNDLF_HOME}/testing/failures.log`](https://github.com/CBICA/GaNDLF/blob/5030ff83a38947c1583b58a08598308886ee9a0a/testing/conftest.py#L25). +Any failures will be reported in the file [`${GaNDLF_HOME}/testing/failures.log`](https://github.com/mlcommons/GaNDLF/blob/5030ff83a38947c1583b58a08598308886ee9a0a/testing/conftest.py#L25). [Back To Top ↑](#table-of-contents) diff --git a/docs/faq.md b/docs/faq.md index 8dc90937e..d7c091d20 100644 --- a/docs/faq.md +++ b/docs/faq.md @@ -14,31 +14,31 @@ This page contains answers to frequently asked questions about GaNDLF. ### Why do I get the error `pkg_resources.DistributionNotFound: The 'GANDLF' distribution was not found`? -This means that GaNDLF was not installed correctly. Please ensure you have followed the [installation guide](https://cbica.github.io/GaNDLF/setup) properly. +This means that GaNDLF was not installed correctly. Please ensure you have followed the [installation guide](https://mlcommons.github.io/GaNDLF/setup) properly. [Back To Top ↑](#table-of-contents) ### Where do I start? -The [usage](https://cbica.github.io/GaNDLF/usage) guide is fairly comprehensive and provides a good starting point. If you have any questions, please feel free to [post a support request](https://github.com/CBICA/GaNDLF/issues/new?assignees=&labels=&template=--questions-help-support.md&title=), and we will do our best to address it ASAP. +The [usage](https://mlcommons.github.io/GaNDLF/usage) guide is fairly comprehensive and provides a good starting point. If you have any questions, please feel free to [post a support request](https://github.com/mlcommons/GaNDLF/issues/new?assignees=&labels=&template=--questions-help-support.md&title=), and we will do our best to address it ASAP. [Back To Top ↑](#table-of-contents) ### Why is GaNDLF not working? -Verify that [the installation](https://cbica.github.io/GaNDLF/setup) has been done correctly by running `python ./gandlf_verifyInstall` after activating the correct virtual environment. If you are still having issues, please feel free to [post a support request](https://github.com/CBICA/GaNDLF/issues/new?assignees=&labels=&template=--questions-help-support.md&title=), and we will do our best to address it ASAP. +Verify that [the installation](https://mlcommons.github.io/GaNDLF/setup) has been done correctly by running `python ./gandlf_verifyInstall` after activating the correct virtual environment. If you are still having issues, please feel free to [post a support request](https://github.com/mlcommons/GaNDLF/issues/new?assignees=&labels=&template=--questions-help-support.md&title=), and we will do our best to address it ASAP. [Back To Top ↑](#table-of-contents) ### Which parts of a GaNDLF configuration are customizable? -Virtually all of it! For more details, please see the [usage](https://cbica.github.io/GaNDLF/usage) guide and our extensive [samples](https://github.com/CBICA/GaNDLF/tree/master/samples). All available options are documented in the [config_all_options.yaml file](https://github.com/CBICA/GaNDLF/blob/master/samples/config_all_options.yaml). +Virtually all of it! For more details, please see the [usage](https://mlcommons.github.io/GaNDLF/usage) guide and our extensive [samples](https://github.com/mlcommons/GaNDLF/tree/master/samples). All available options are documented in the [config_all_options.yaml file](https://github.com/mlcommons/GaNDLF/blob/master/samples/config_all_options.yaml). [Back To Top ↑](#table-of-contents) ### Can I run GaNDLF on a high performance computing (HPC) cluster? -YES, we have run GaNDLF on an SGE cluster to great success. Please [post a question](https://github.com/CBICA/GaNDLF/issues/new?assignees=&labels=&template=--questions-help-support.md&title=) with more details such as the type of scheduler, and so on, and we will do our best to address it. +YES, we have run GaNDLF on an SGE cluster to great success. Please [post a question](https://github.com/mlcommons/GaNDLF/issues/new?assignees=&labels=&template=--questions-help-support.md&title=) with more details such as the type of scheduler, and so on, and we will do our best to address it. [Back To Top ↑](#table-of-contents) @@ -56,12 +56,12 @@ GaNDLF allows you to resume training from a previous checkpoint in 2 ways: ### How can I update GaNDLF? -If you have performed `git clone` [during installation](https://cbica.github.io/GaNDLF/setup), then you will need to do `git pull` to get the latest master of GaNDLF. Follow this up with `pip install -e .` after activating the appropriate virtual environment to ensure the updates get passed through. +If you have performed `git clone` [during installation](https://mlcommons.github.io/GaNDLF/setup), then you will need to do `git pull` to get the latest master of GaNDLF. Follow this up with `pip install -e .` after activating the appropriate virtual environment to ensure the updates get passed through. [Back To Top ↑](#table-of-contents) ### What I have another question? -Please [post a support request](https://github.com/CBICA/GaNDLF/issues/new?assignees=&labels=&template=--questions-help-support.md&title=). +Please [post a support request](https://github.com/mlcommons/GaNDLF/issues/new?assignees=&labels=&template=--questions-help-support.md&title=). [Back To Top ↑](#table-of-contents) diff --git a/docs/index.md b/docs/index.md index 067735bc2..8e391cac0 100644 --- a/docs/index.md +++ b/docs/index.md @@ -27,5 +27,5 @@ The **G**ener**a**lly **N**uanced **D**eep **L**earning **F**ramework for segmen ## Contact GaNDLF developers can be reached via the following ways: -- [GitHub Discussions](https://github.com/CBICA/GaNDLF/discussions) +- [GitHub Discussions](https://github.com/mlcommons/GaNDLF/discussions) - [Email](mailto:gandlf@cbica.upenn.edu) \ No newline at end of file diff --git a/docs/setup.md b/docs/setup.md index 26f2f6843..cabd7c959 100644 --- a/docs/setup.md +++ b/docs/setup.md @@ -21,7 +21,7 @@ The instructions assume a system using NVIDIA GPUs with [CUDA 10.2](https://developer.nvidia.com/cuda-toolkit-archive) (for AMD, please make the appropriate change during PyTorch installation from [their installation page](https://pytorch.org/get-started/locally)). ```bash -git clone https://github.com/CBICA/GaNDLF.git +git clone https://github.com/mlcommons/GaNDLF.git cd GaNDLF conda create -n venv_gandlf python=3.8 -y conda activate venv_gandlf diff --git a/docs/usage.md b/docs/usage.md index ccc96d373..4d111d81e 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -87,7 +87,7 @@ This will save the processed data in `./experiment_0/output_dir/` with a new dat ## Constructing the Data CSV -This application can leverage multiple channels/modalities for training while using a multi-class segmentation file. The expected format is shown as an example in [samples/sample_train.csv](https://github.com/CBICA/GaNDLF/blob/master/samples/sample_train.csv) and needs to be structured with the following header format (which shows a CSV with `N` subjects, each having `X` channels/modalities that need to be processed): +This application can leverage multiple channels/modalities for training while using a multi-class segmentation file. The expected format is shown as an example in [samples/sample_train.csv](https://github.com/mlcommons/GaNDLF/blob/master/samples/sample_train.csv) and needs to be structured with the following header format (which shows a CSV with `N` subjects, each having `X` channels/modalities that need to be processed): ```csv SubjectID,Channel_0,Channel_1,...,Channel_X,Label @@ -102,7 +102,7 @@ N,/full/path/N/0.nii.gz,/full/path/N/1.nii.gz,...,/full/path/N/X.nii.gz,/full/pa - `ValueToPredict` is used for regression/classification models - Only a single `Label` header should be passed (multiple segmentation classes should be in a single file with unique label numbers) -The [gandlf_constructCSV](https://github.com/CBICA/GaNDLF/blob/master/gandlf_constructCSV) can be used to make this easier: +The [gandlf_constructCSV](https://github.com/mlcommons/GaNDLF/blob/master/gandlf_constructCSV) can be used to make this easier: ```bash # continue from previous shell @@ -169,11 +169,11 @@ GaNDLF requires a YAML-based configuration that controls various aspects of the - Testing - Validation -Please see a [sample](https://github.com/CBICA/GaNDLF/blob/master/samples/config_all_options.yaml) for detailed guide and comments. +Please see a [sample](https://github.com/mlcommons/GaNDLF/blob/master/samples/config_all_options.yaml) for detailed guide and comments. -- [Segmentation example](https://github.com/CBICA/GaNDLF/blob/master/samples/config_segmentation_brats.yaml) -- [Regression example](https://github.com/CBICA/GaNDLF/blob/master/samples/config_regression.yaml) -- [Classification example](https://github.com/CBICA/GaNDLF/blob/master/samples/config_classification.yaml) +- [Segmentation example](https://github.com/mlcommons/GaNDLF/blob/master/samples/config_segmentation_brats.yaml) +- [Regression example](https://github.com/mlcommons/GaNDLF/blob/master/samples/config_regression.yaml) +- [Classification example](https://github.com/mlcommons/GaNDLF/blob/master/samples/config_classification.yaml) **Note**: Ensure that the configuration has valid syntax by checking the file using any YAML validator such as [yamlchecker.com](https://yamlchecker.com/) or [yamlvalidator.com](https://yamlvalidator.com/) **before** trying to train. @@ -201,7 +201,7 @@ python gandlf_run \ ## Plot the final results -After the testing/validation training is finished, GaNDLF makes it possible to collect all the statistics from the final models for testing and validation datasets and plot them. The [gandlf_collectStats](https://github.com/CBICA/GaNDLF/blob/master/gandlf_collectStats) can be used for this: +After the testing/validation training is finished, GaNDLF makes it possible to collect all the statistics from the final models for testing and validation datasets and plot them. The [gandlf_collectStats](https://github.com/mlcommons/GaNDLF/blob/master/gandlf_collectStats) can be used for this: ```bash # continue from previous shell @@ -216,7 +216,7 @@ python gandlf_collectStats \ Please ensure that the environment variable `CUDA_VISIBLE_DEVICES` is set [[ref](https://developer.nvidia.com/blog/cuda-pro-tip-control-gpu-visibility-cuda_visible_devices/)]. -For an example how this is set, see [sge_wrapper](https://github.com/CBICA/GaNDLF/blob/master/samples/sge_wrapper). +For an example how this is set, see [sge_wrapper](https://github.com/mlcommons/GaNDLF/blob/master/samples/sge_wrapper). [Back To Top ↑](#table-of-contents) @@ -250,5 +250,5 @@ Link to the original repository: https://github.com/MECLabTUDA/M3d-Cam ## Examples -- Example data can be found in [the main repo](https://github.com/CBICA/GaNDLF/raw/master/testing/data.zip); this contains both 3D and 2D data that can be used to run various workloads. -- Configurations can be found in [the main repo](https://github.com/CBICA/GaNDLF/tree/master/testing). +- Example data can be found in [the main repo](https://github.com/mlcommons/GaNDLF/raw/master/testing/data.zip); this contains both 3D and 2D data that can be used to run various workloads. +- Configurations can be found in [the main repo](https://github.com/mlcommons/GaNDLF/tree/master/testing). From d1475f141972f974e6fcf6577685a193840672dd Mon Sep 17 00:00:00 2001 From: sarthakpati Date: Mon, 24 Oct 2022 11:35:51 -0400 Subject: [PATCH 04/13] links updated in template and docs --- .github/ISSUE_TEMPLATE/--questions-help-support.md | 2 +- SECURITY.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/--questions-help-support.md b/.github/ISSUE_TEMPLATE/--questions-help-support.md index 271d786cf..062eb59f7 100644 --- a/.github/ISSUE_TEMPLATE/--questions-help-support.md +++ b/.github/ISSUE_TEMPLATE/--questions-help-support.md @@ -8,7 +8,7 @@ assignees: '' --- **GaNDLF Version** diff --git a/SECURITY.md b/SECURITY.md index f06dc792e..316a8c4b0 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -13,7 +13,7 @@ currently being supported with security updates. ## Reporting a PUBLIC Vulnerability -Please report any vulnerabilities that can be publicly shared via [GitHub Issues](https://github.com/CBICA/GaNDLF/issues/new/choose). +Please report any vulnerabilities that can be publicly shared via [GitHub Issues](https://github.com/mlcommons/GaNDLF/issues/new/choose). ## Reporting a PRIVATE Vulnerability From 70915356c800580eb1b3e1f79e27c5bf5bb96ec1 Mon Sep 17 00:00:00 2001 From: sarthakpati Date: Mon, 24 Oct 2022 11:35:57 -0400 Subject: [PATCH 05/13] links updated in cli --- gandlf_verifyInstall | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gandlf_verifyInstall b/gandlf_verifyInstall index 60edee31b..3f0a2dd6a 100644 --- a/gandlf_verifyInstall +++ b/gandlf_verifyInstall @@ -20,7 +20,7 @@ if __name__ == "__main__": print("GaNDLF installed version:", gf.__version__) except: raise Exception( - "GaNDLF not properly installed, please see https://cbica.github.io/GaNDLF/setup" + "GaNDLF not properly installed, please see https://mlcommons.github.io/GaNDLF/setup" ) # we always want to do submodule update to ensure any hash updates are ingested correctly @@ -32,4 +32,4 @@ if __name__ == "__main__": args = parser.parse_args() - print("GaNDLF is ready. See https://cbica.github.io/GaNDLF/usage") + print("GaNDLF is ready. See https://mlcommons.github.io/GaNDLF/usage") From ee311df3d60210dd5d923de1fe714bcd46aa80e6 Mon Sep 17 00:00:00 2001 From: sarthakpati Date: Mon, 24 Oct 2022 11:36:28 -0400 Subject: [PATCH 06/13] links updated for docker image creation --- .github/workflows/docker-image.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index d84d3b009..3c5803184 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -54,7 +54,7 @@ jobs: # Below steps are for GitHub Packages integration, metadata and signing - # See https://github.com/CBICA/GaNDLF/new/master?filename=.github%2Fworkflows%2Fdocker-publish.yml&workflow_template=docker-publish + # See https://github.com/mlcommons/GaNDLF/new/master?filename=.github%2Fworkflows%2Fdocker-publish.yml&workflow_template=docker-publish # Install the cosign tool except on PR # https://github.com/sigstore/cosign-installer From 7354ca4bf47196ab98b61cd46d4ae7e81dc569ca Mon Sep 17 00:00:00 2001 From: sarthakpati Date: Mon, 24 Oct 2022 11:36:41 -0400 Subject: [PATCH 07/13] links updated in code comments --- GANDLF/data/ImagesFromDataFrame.py | 2 +- GANDLF/utils/generic.py | 2 +- setup.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/GANDLF/data/ImagesFromDataFrame.py b/GANDLF/data/ImagesFromDataFrame.py index 89dba632d..b67be1da8 100644 --- a/GANDLF/data/ImagesFromDataFrame.py +++ b/GANDLF/data/ImagesFromDataFrame.py @@ -171,7 +171,7 @@ def ImagesFromDataFrame( # Initializing the subject object using the dict subject = torchio.Subject(subject_dict) # https://github.com/fepegar/torchio/discussions/587#discussioncomment-928834 - # this is causing memory usage to explode, see https://github.com/CBICA/GaNDLF/issues/128 + # this is causing memory usage to explode, see https://github.com/mlcommons/GaNDLF/issues/128 if parameters["verbose"]: print( "Checking consistency of images in subject '" diff --git a/GANDLF/utils/generic.py b/GANDLF/utils/generic.py index eae1d2b9b..9bcb87a61 100644 --- a/GANDLF/utils/generic.py +++ b/GANDLF/utils/generic.py @@ -28,7 +28,7 @@ def checkPatchDivisibility(patch_size, number=16): if np.count_nonzero(np.remainder(patch_size_to_check, number)) > 0: return False - # adding check to address https://github.com/CBICA/GaNDLF/issues/53 + # adding check to address https://github.com/mlcommons/GaNDLF/issues/53 # there is quite possibly a better way to do this unique = np.unique(patch_size_to_check) if (unique.shape[0] == 1) and (unique[0] <= number): diff --git a/setup.py b/setup.py index b67781993..6d6060c35 100644 --- a/setup.py +++ b/setup.py @@ -82,7 +82,7 @@ def run(self): "ACSConv==0.1.1", ] -# pytorch doesn't have LTS support on OSX - https://github.com/CBICA/GaNDLF/issues/389 +# pytorch doesn't have LTS support on OSX - https://github.com/mlcommons/GaNDLF/issues/389 if sys.platform == "darwin": requirements.append("torch==1.11.0") else: From f10f3c761eb611c3d72ffa631f509f020296ac73 Mon Sep 17 00:00:00 2001 From: sarthakpati Date: Mon, 24 Oct 2022 11:48:46 -0400 Subject: [PATCH 08/13] emails updated --- CODE_OF_CONDUCT.md | 2 +- GANDLF/cli/__init__.py | 2 +- SECURITY.md | 2 +- docs/index.md | 2 +- setup.py | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 7bba78704..eeced7a89 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -55,7 +55,7 @@ further defined and clarified by project maintainers. ## Enforcement Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported by contacting the project team at software@cbica.upenn.edu. All +reported by contacting the project team at [via email](mailto:gandlf@cbica.upenn.edu). All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. diff --git a/GANDLF/cli/__init__.py b/GANDLF/cli/__init__.py index 28350a300..3864c6149 100644 --- a/GANDLF/cli/__init__.py +++ b/GANDLF/cli/__init__.py @@ -5,7 +5,7 @@ from datetime import date copyrightMessage = ( - "Contact: gandlf@cbica.upenn.edu\n\n" + "Contact: gandlf@mlcommons.org\n\n" + "This program is NOT FDA/CE approved and NOT intended for clinical use.\nCopyright (c) " + str(date.today().year) + " MLCommons. All rights reserved.\n\nCitation: https://arxiv.org/abs/2103.01006" diff --git a/SECURITY.md b/SECURITY.md index 316a8c4b0..a5b6c4d9a 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -17,4 +17,4 @@ Please report any vulnerabilities that can be publicly shared via [GitHub Issues ## Reporting a PRIVATE Vulnerability -Please report any vulnerabilities that cannot be publicly shared via [email](mailto:gandlf@cbica.upenn.edu). +Please report any vulnerabilities that cannot be publicly shared via [email](mailto:gandlf@mlcommons.org). diff --git a/docs/index.md b/docs/index.md index 8e391cac0..c3d362b0e 100644 --- a/docs/index.md +++ b/docs/index.md @@ -28,4 +28,4 @@ The **G**ener**a**lly **N**uanced **D**eep **L**earning **F**ramework for segmen GaNDLF developers can be reached via the following ways: - [GitHub Discussions](https://github.com/mlcommons/GaNDLF/discussions) -- [Email](mailto:gandlf@cbica.upenn.edu) \ No newline at end of file +- [Email](mailto:gandlf@mlcommons.org) \ No newline at end of file diff --git a/setup.py b/setup.py index 6d6060c35..edc3ac2ab 100644 --- a/setup.py +++ b/setup.py @@ -92,7 +92,7 @@ def run(self): name="GANDLF", version=__version__, author="Jose Agraz, Vinayak Ahluwalia, Bhakti Baheti, Spyridon Bakas, Ujjwal Baid, Megh Bhalerao, Brandon Edwards, Karol Gotkowski, Caleb Grenko, Orhun Güley, Ibrahim Ethem Hamamci, Sarthak Pati, Micah Sheller, Juliia Skobleva, Siddhesh Thakur, Spiros Thermos", # alphabetical order - author_email="software@cbica.upenn.edu", + author_email="gandlf@mlcommons.org", python_requires=">=3.7", packages=find_packages(), cmdclass={ # this ensures git_submodule_update is called during install From 12c5e1f44da2957a94dedf87684ddf448dde343c Mon Sep 17 00:00:00 2001 From: sarthakpati Date: Mon, 24 Oct 2022 14:33:11 -0400 Subject: [PATCH 09/13] additional package info updated --- setup.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index edc3ac2ab..eb6818f3e 100644 --- a/setup.py +++ b/setup.py @@ -91,7 +91,7 @@ def run(self): setup( name="GANDLF", version=__version__, - author="Jose Agraz, Vinayak Ahluwalia, Bhakti Baheti, Spyridon Bakas, Ujjwal Baid, Megh Bhalerao, Brandon Edwards, Karol Gotkowski, Caleb Grenko, Orhun Güley, Ibrahim Ethem Hamamci, Sarthak Pati, Micah Sheller, Juliia Skobleva, Siddhesh Thakur, Spiros Thermos", # alphabetical order + author="MLCommons", author_email="gandlf@mlcommons.org", python_requires=">=3.7", packages=find_packages(), @@ -118,16 +118,17 @@ def run(self): "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", "Topic :: Scientific/Engineering :: Medical Science Apps", ], description=( "PyTorch-based framework that handles segmentation/regression/classification using various DL architectures for medical imaging." ), install_requires=requirements, - license="BSD-3-Clause License", + license="Apache-2.0", long_description=readme, long_description_content_type="text/markdown", include_package_data=True, - keywords="semantic, segmentation, regression, classification, data-augmentation, medical-imaging", + keywords="semantic, segmentation, regression, classification, data-augmentation, medical-imaging, clinical-workflows, deep-learning, pytorch", zip_safe=False, ) From 1ac8441bd4b3956d756b15063b6bee6026a4ea09 Mon Sep 17 00:00:00 2001 From: sarthakpati Date: Mon, 24 Oct 2022 15:36:50 -0400 Subject: [PATCH 10/13] email updated --- CODE_OF_CONDUCT.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index eeced7a89..82156524b 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -55,7 +55,7 @@ further defined and clarified by project maintainers. ## Enforcement Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported by contacting the project team at [via email](mailto:gandlf@cbica.upenn.edu). All +reported by contacting the project team at [via email](mailto:gandlf@mlcommons.org). All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. From f1b4d279a2e818a5aa1091dfb2cf8a61211da923 Mon Sep 17 00:00:00 2001 From: sarthakpati Date: Mon, 24 Oct 2022 15:39:13 -0400 Subject: [PATCH 11/13] updated to remove cbica and upenn references --- GANDLF/models/seg_modules/Readme.md | 2 +- GANDLF/models/uinc.py | 6 +++--- docs/rst/conf.py | 4 ++-- testing/config_segmentation.yaml | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/GANDLF/models/seg_modules/Readme.md b/GANDLF/models/seg_modules/Readme.md index 2c44b377b..46db075bd 100644 --- a/GANDLF/models/seg_modules/Readme.md +++ b/GANDLF/models/seg_modules/Readme.md @@ -1,5 +1,5 @@ ### Description -Link to the paper (CBICA): https://arxiv.org/pdf/1907.02110.pdf. +Link to the paper: https://arxiv.org/pdf/1907.02110.pdf. This folder contains the smaller modules that are integrated to form the larger Inc U Net arch. diff --git a/GANDLF/models/uinc.py b/GANDLF/models/uinc.py index 001f32396..04b7d3416 100644 --- a/GANDLF/models/uinc.py +++ b/GANDLF/models/uinc.py @@ -18,11 +18,11 @@ class uinc(ModelBase): """ - This is the implementation of the following paper: https://arxiv.org/abs/1907.02110 - (from CBICA). Please look at the seg_module files (towards the end), to get a better sense of + This is the implementation of the following paper: https://arxiv.org/abs/1907.02110. + Please look at the seg_module files (towards the end), to get a better sense of the Inception Module implemented. The res parameter is for the addition of the initial feature map with the final feature map after performance of the convolution. For the decoding module, - not the initial input but the input after the first convolution is addded to the final output + not the initial input but the input after the first convolution is added to the final output since the initial input and the final one do not have the same dimensions. """ diff --git a/docs/rst/conf.py b/docs/rst/conf.py index a1c1f521e..2d0f4cecb 100644 --- a/docs/rst/conf.py +++ b/docs/rst/conf.py @@ -18,8 +18,8 @@ # -- Project information ----------------------------------------------------- project = "GANDLF" -copyright_str = "2020, CBICA, UPenn" -author = "CBICA, UPenn" +copyright_str = "2022, MLCommons" +author = "MLCommons" # The full version, including alpha/beta/rc tags release = "0.0.3.NR" diff --git a/testing/config_segmentation.yaml b/testing/config_segmentation.yaml index 177d1718c..a0e531638 100644 --- a/testing/config_segmentation.yaml +++ b/testing/config_segmentation.yaml @@ -108,7 +108,7 @@ data_postprocessing: # this gets passed before the training_loop, so ensure enough memory is provided along with other parameters # that your HPC would expect # ${outputDir} will be changed to the outputDir you pass in CLI + '/${fold_number}' -#parallel_compute_command: 'qsub -b y -l gpu -l h_vmem=80G -pe threaded 6 /cbica/home/patis/projects/deep-sage-experiments/brats/sge_wrapper /cbica/home/patis/projects/GANDLF_master/venv/bin/python ' +#parallel_compute_command: q_max_length: 1 From b287899d324f5d787a155b3b247f7a6b9f19a0cc Mon Sep 17 00:00:00 2001 From: sarthakpati Date: Tue, 25 Oct 2022 06:18:56 -0400 Subject: [PATCH 12/13] note updated --- HISTORY.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/HISTORY.md b/HISTORY.md index 29ac93ed5..e3588926c 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,6 +1,7 @@ -## 0.0.16- +## 0.0.16 - ImageNet pre-trained models for UNet with variable encoders is now available - ACS/Soft conversion is available for ImageNet-pretrained UNet +- Updated links, copyright and email to MLCommons ## 0.0.15 - Updated `setup.py` for `python>=3.8` From c9015e25d9e2df1dbcb4f55423ea16552fd0c64d Mon Sep 17 00:00:00 2001 From: Sarthak Pati Date: Tue, 25 Oct 2022 12:48:03 +0000 Subject: [PATCH 13/13] black . --- GANDLF/models/uinc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GANDLF/models/uinc.py b/GANDLF/models/uinc.py index 04b7d3416..55e771353 100644 --- a/GANDLF/models/uinc.py +++ b/GANDLF/models/uinc.py @@ -18,7 +18,7 @@ class uinc(ModelBase): """ - This is the implementation of the following paper: https://arxiv.org/abs/1907.02110. + This is the implementation of the following paper: https://arxiv.org/abs/1907.02110. Please look at the seg_module files (towards the end), to get a better sense of the Inception Module implemented. The res parameter is for the addition of the initial feature map with the final feature map after performance of the convolution. For the decoding module,