for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
import sys
The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:
class SomeClass: def some_method(self): """Do x and return foo."""
If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.
import logging
logging.basicConfig(stream=sys.stdout, level=logging.INFO)
def DICOM_validator(file_path):
DICOM_validator
(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$
This check looks for invalid names for a range of different identifiers.
You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.
If your project includes a Pylint configuration file, the settings contained in that file take precedence.
To find out more about Pylint, please refer to their site.
"""
validate to check if the DICOM file is an actual DICOM file.
:param file_path:
:return:
logger = logging.getLogger(__name__)
global dicom
dicom
(([A-Z_][A-Z0-9_]*)|(__.*__))$
dicom = None
from pydicom.filereader import InvalidDicomError
from pydicom.filereader import read_file
try:
dicom = read_file(file_path)
except InvalidDicomError:
logger.info(file_path + " is not a DICOM file. Skipping")
return False, None
return True, dicom
def DICOM_batchValidator(dir_path):
DICOM_batchValidator
dir_path
Some basic information of the participants must be consistent across the files, such as the SCAN DATE (assuming they are not scanning across MIDNIGHT POINT)
This check looks for lines that are too long. You can specify the maximum line length.
Birthday date, subject name, etc MUST BE CONSISTENT across a SINGLE subject's folder, RIGHT!
:param dir_path:
#if __name__ == '__main__':
The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:
If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.