Skip to content

Commit

Permalink
added Siemens_mMR_NEMA_IQ_lowcounts
Browse files Browse the repository at this point in the history
  • Loading branch information
KrisThielemans committed Sep 20, 2024
1 parent aae6ed3 commit cb70ded
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 2 deletions.
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import argparse
import logging
import os

from ..data_utilities import prepare_challenge_Siemens_data, the_data_path, the_orgdata_path

this_directory = os.path.dirname(__file__)
repo_directory = os.path.dirname(this_directory)
challenge_data_path = os.path.join(repo_directory, 'data')

if __name__ == '__main__':
parser = argparse.ArgumentParser(description='SyneRBI PETRIC Siemens mMR NEMA IQ data preparation script.')

parser.add_argument('--log', type=str, default='warning')
parser.add_argument('--start', type=float, default=0)
parser.add_argument('--end', type=float, default=100)
parser.add_argument('--raw_data_path', type=str, default=None)
args = parser.parse_args()

if args.log in ['debug', 'info', 'warning', 'error', 'critical']:
level = eval(f'logging.{args.log.upper()}')
logging.basicConfig(level=level)
logging.info(f"Setting logging level to {args.log.upper()}")

start = args.start
end = args.end

if args.raw_data_path is None:
data_path = the_orgdata_path('Siemens_mMR_NEMA_IQ', 'raw', 'NEMA_IQ')
else:
data_path = args.raw_data_path

data_path = os.path.abspath(data_path)
logging.debug(f"Raw data path: {data_path}")

intermediate_data_path = the_orgdata_path('Siemens_mMR_NEMA_IQ_lowcounts', 'processing')
challenge_data_path = the_data_path('Siemens_mMR_NEMA_IQ_lowcounts')

os.makedirs(challenge_data_path, exist_ok=True)
os.chdir(challenge_data_path)
os.makedirs(intermediate_data_path, exist_ok=True)

f_template = os.path.join(data_path, 'mMR_template_span11.hs')

prepare_challenge_Siemens_data(data_path, challenge_data_path, intermediate_data_path, '20170809_NEMA_',
'60min_UCL.l.hdr', 'MUMAP_UCL.v', 'MUMAP_UCL.hv', 'UCL.n', 'norm.n.hdr', f_template,
'prompts', 'mult_factors', 'additive_term', 'randoms', 'attenuation_factor',
'attenuation_correction_factor', 'scatter', start, end)
4 changes: 2 additions & 2 deletions SIRF_data_preparation/dataset_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
from petric import DATA_SLICES

DATA_SUBSETS = {
'Siemens_mMR_NEMA_IQ': 7, 'Siemens_mMR_ACR': 7, 'NeuroLF_Hoffman_Dataset': 16, 'Mediso_NEMA_IQ': 12,
'Siemens_Vision600_thorax': 5}
'Siemens_mMR_NEMA_IQ': 7, 'Siemens_mMR_NEMA_IQ_lowcounts': 7, 'Siemens_mMR_ACR': 7, 'NeuroLF_Hoffman_Dataset': 16,
'Mediso_NEMA_IQ': 12, 'Siemens_Vision600_thorax': 5}


@dataclass
Expand Down
1 change: 1 addition & 0 deletions petric.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@ def get_image(fname):

DATA_SLICES = {
'Siemens_mMR_NEMA_IQ': {'transverse_slice': 72, 'coronal_slice': 109}, # 'sagittal_slice': 89
'Siemens_mMR_NEMA_IQ_lowcounts': {'transverse_slice': 72, 'coronal_slice': 109, 'sagittal_slice': 89},
'Siemens_mMR_ACR': {'transverse_slice': 99},
'NeuroLF_Hoffman_Dataset': {'transverse_slice': 72},
'Mediso_NEMA_IQ': {'transverse_slice': 22, 'coronal_slice': 89, 'sagittal_slice': 66},
Expand Down

0 comments on commit cb70ded

Please sign in to comment.