From 8c9e6bbff01996d370d3a9bd5723d36f3c13b858 Mon Sep 17 00:00:00 2001 From: Oli Date: Fri, 21 Feb 2025 18:15:22 +0000 Subject: [PATCH 1/3] BF Update mmraux.py Change deprecated read_file to dcmread --- niftypet/nipet/mmraux.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/niftypet/nipet/mmraux.py b/niftypet/nipet/mmraux.py index 54584220..77f64aab 100644 --- a/niftypet/nipet/mmraux.py +++ b/niftypet/nipet/mmraux.py @@ -36,9 +36,9 @@ def fwhm2sig(fwhm): def lm_pos(datain, Cnt): '''get the position of table and gantry offset from the DICOM list-mode file''' if 'lm_dcm' in datain and os.path.isfile(datain['lm_dcm']): - dhdr = dcm.read_file(datain['lm_dcm']) + dhdr = dcm.dcmread(datain['lm_dcm']) elif 'lm_ima' in datain and os.path.isfile(datain['lm_ima']): - dhdr = dcm.read_file(datain['lm_ima']) + dhdr = dcm.dcmread(datain['lm_ima']) else: log.error('DICOM list-mode data not found!') return None @@ -91,9 +91,9 @@ def lm_pos(datain, Cnt): def hdr_lm(datain, Cnt): '''Get the headers from DICOM list-mode data file''' if 'lm_dcm' in datain and os.path.isfile(datain['lm_dcm']): - dhdr = dcm.read_file(datain['lm_dcm']) + dhdr = dcm.dcmread(datain['lm_dcm']) elif 'lm_ima' in datain and os.path.isfile(datain['lm_ima']): - dhdr = dcm.read_file(datain['lm_ima']) + dhdr = dcm.dcmread(datain['lm_ima']) else: log.error('DICOM list-mode data not found!') return None @@ -226,9 +226,9 @@ def hmu_resample0(hmupos, parts, Cnt): def time_diff_norm_acq(datain): if 'lm_dcm' in datain and os.path.isfile(datain['lm_dcm']): - dcm_lm = dcm.read_file(datain['lm_dcm']) + dcm_lm = dcm.dcmread(datain['lm_dcm']) elif 'lm_ima' in datain and os.path.isfile(datain['lm_ima']): - dcm_lm = dcm.read_file(datain['lm_ima']) + dcm_lm = dcm.dcmread(datain['lm_ima']) else: log.error('dicom header of list-mode data does not exist.') return None From ab9dcd138ab3608c418431066cb209a75fac0648 Mon Sep 17 00:00:00 2001 From: Oli Date: Fri, 21 Feb 2025 18:18:56 +0000 Subject: [PATCH 2/3] Update mmrimg.py Update read_file to dcmread --- niftypet/nipet/img/mmrimg.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/niftypet/nipet/img/mmrimg.py b/niftypet/nipet/img/mmrimg.py index ed3e0c4a..efff1c37 100644 --- a/niftypet/nipet/img/mmrimg.py +++ b/niftypet/nipet/img/mmrimg.py @@ -745,7 +745,7 @@ def hdr_mu(datain, Cnt): else: raise NameError('no DICOM or DICOM filed found!') if os.path.isfile(dcmf): - dhdr = dcm.read_file(dcmf) + dhdr = dcm.dcmread(dcmf) else: log.error('DICOM mMR mu-maps are not valid files!') return None From cba03cdfcddc8188d51edeee17a24c55d5401fa1 Mon Sep 17 00:00:00 2001 From: Oli Date: Tue, 25 Feb 2025 13:14:32 +0000 Subject: [PATCH 3/3] Update mmrnorm.py change read_image to dcmread --- niftypet/nipet/mmrnorm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/niftypet/nipet/mmrnorm.py b/niftypet/nipet/mmrnorm.py index 9ced14c2..2c90701b 100644 --- a/niftypet/nipet/mmrnorm.py +++ b/niftypet/nipet/mmrnorm.py @@ -70,7 +70,7 @@ def get_components(datain, Cnt): # possible DICOM locations for the Interfile header nhdr_locations = [[0x29, 0x1010], [0x29, 0x1110]] # read the DICOM file - d = dcm.read_file(fnrm_hdr) + d = dcm.dcmread(fnrm_hdr) # if d[0x0018, 0x1020].value == 'syngo MR B20P' or d[0x0018, 0x1020].value == 'syngo MR E11': # nhdr = d[0x29,0x1010].value.decode()