Skip to content

Commit d97819b

Browse files
committed
updated is_pet.py too
1 parent 6230a94 commit d97819b

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

pypet2bids/pypet2bids/is_pet.py

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,28 +15,21 @@
1515
import helper_functions
1616
import ecat
1717
import dcm2niix4pet
18+
import metadata
1819
except ModuleNotFoundError:
1920
import pypet2bids.helper_functions as helper_functions
2021
import pypet2bids.ecat as ecat
2122
import pypet2bids.dcm2niix4pet as dcm2niix4pet
23+
import pypet2bids.metadata
2224

2325

2426
def spread_sheet_check_for_pet(sourcefile: Union[str, Path], **kwargs):
2527
# load data from spreadsheet
2628
data = helper_functions.open_meta_data(sourcefile)
2729

28-
# load BIDS PET requirements
2930
try:
30-
with open(
31-
helper_functions.pet_metadata_json, "r"
32-
) as pet_field_requirements_json:
33-
pet_field_requirements = json.load(pet_field_requirements_json)
34-
except (FileNotFoundError, json.JSONDecodeError) as error:
35-
print(
36-
f"Unable to load list of required, recommended, and optional PET BIDS fields from"
37-
f" {helper_functions.pet_metadata_json}, will not be able to determine if sourcefile contains"
38-
f" PET BIDS specific metadata"
39-
)
31+
pet_field_requirements = metadata.PET_metadata
32+
except:
4033
pet_field_requirements = {}
4134

4235
mandatory_fields = pet_field_requirements.get("mandatory", [])

0 commit comments

Comments
 (0)