File tree Expand file tree Collapse file tree 3 files changed +20
-8
lines changed Expand file tree Collapse file tree 3 files changed +20
-8
lines changed Original file line number Diff line number Diff line change 44 import read_ecat
55 import helper_functions
66except ImportError :
7- from pypet2bids .ecat import ecat
8- from pypet2bids .write_ecat import write_ecat
9- from pypet2bids .read_ecat import read_ecat
10- from pypet2bids import helper_functions
7+ import pypet2bids .ecat as ecat
8+ import pypet2bids .write_ecat as write_ecat
9+ import pypet2bids .read_ecat as read_ecat
10+ import pypet2bids . helper_functions as helper_functions
1111
1212# collect ecat header jsons
1313ecat_headers = read_ecat .ecat_header_maps .get ("ecat_headers" )
Original file line number Diff line number Diff line change 1+ #!/usr/bin/env python3
2+
13from pathlib import Path
24from os .path import join
35from os import listdir
1315
1416try :
1517 import helper_functions
16- import is_pet
18+ # The import of is_pet is deferred to get_metadata_from_spreadsheet() to
19+ # prevent circular import
20+ #import is_pet
1721 import pet_metadata as metadata
1822except ModuleNotFoundError :
1923 import pypet2bids .helper_functions as helper_functions
20- import pypet2bids .is_pet as is_pet
24+ # The import of is_pet is deferred to get_metadata_from_spreadsheet() to
25+ # prevent circular import
26+ #import pypet2bids.is_pet as is_pet
2127 import pypet2bids .pet_metadata as metadata
2228
2329# import logging
@@ -761,6 +767,12 @@ def get_metadata_from_spreadsheet(
761767 :return: dictionary of metadata
762768 :rtype: dict
763769 """
770+ # Import is_pet here to avoid circular import
771+ try :
772+ import is_pet
773+ except ModuleNotFoundError :
774+ import pypet2bids .is_pet as is_pet
775+
764776 spreadsheet_metadata = {"nifti_json" : {}, "blood_json" : {}, "blood_tsv" : {}}
765777 spreadsheet_values = {}
766778 if Path (metadata_path ).is_file ():
Original file line number Diff line number Diff line change @@ -64,8 +64,8 @@ convert-pmod-to-blood = "pypet2bids.convert_pmod_to_blood:main"
6464ispet = " pypet2bids.is_pet:main"
6565updatepetjsonfromdicom = " pypet2bids.dcm2niix4pet:update_json_with_dicom_value_cli"
6666updatepetjsonfromecat = " pypet2bids.ecat_cli:update_json_with_ecat_value_cli"
67- updatepetjson = " pypet2bids.update_json :update_json_cli"
68- ecatheaderupdate = " pypet2bids.ecat_header_update:main "
67+ updatepetjson = " pypet2bids.update_json_pet_file :update_json_cli"
68+ ecatheaderupdate = " pypet2bids.ecat_header_update:cli "
6969
7070[project .urls ]
7171Documentation = " https://pypet2bids.readthedocs.io/en/latest/"
You can’t perform that action at this time.
0 commit comments