From 2a82830e88cb65d7da5f2f06cb0094bcf4af7251 Mon Sep 17 00:00:00 2001 From: Paul Wighton Date: Wed, 19 Nov 2025 19:13:52 -0500 Subject: [PATCH 1/3] [FIX] fixing the execution of updatepetjson and ecatheaderupdate --- pypet2bids/pypet2bids/ecat_header_update.py | 8 ++++---- pypet2bids/pypet2bids/update_json_pet_file.py | 16 ++++++++++++++-- pypet2bids/pyproject.toml | 4 ++-- 3 files changed, 20 insertions(+), 8 deletions(-) mode change 100644 => 100755 pypet2bids/pypet2bids/update_json_pet_file.py diff --git a/pypet2bids/pypet2bids/ecat_header_update.py b/pypet2bids/pypet2bids/ecat_header_update.py index 2c54878e..305351f8 100644 --- a/pypet2bids/pypet2bids/ecat_header_update.py +++ b/pypet2bids/pypet2bids/ecat_header_update.py @@ -4,10 +4,10 @@ import read_ecat import helper_functions except ImportError: - from pypet2bids.ecat import ecat - from pypet2bids.write_ecat import write_ecat - from pypet2bids.read_ecat import read_ecat - from pypet2bids import helper_functions + import pypet2bids.ecat as ecat + import pypet2bids.write_ecat as write_ecat + import pypet2bids.read_ecat as read_ecat + import pypet2bids.helper_functions as helper_functions # collect ecat header jsons ecat_headers = read_ecat.ecat_header_maps.get("ecat_headers") diff --git a/pypet2bids/pypet2bids/update_json_pet_file.py b/pypet2bids/pypet2bids/update_json_pet_file.py old mode 100644 new mode 100755 index 5302569e..26ff75f7 --- a/pypet2bids/pypet2bids/update_json_pet_file.py +++ b/pypet2bids/pypet2bids/update_json_pet_file.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python3 + from pathlib import Path from os.path import join from os import listdir @@ -13,11 +15,15 @@ try: import helper_functions - import is_pet + # The import of is_pet is deferred to get_metadata_from_spreadsheet() to + # prevent circular import + #import is_pet import pet_metadata as metadata except ModuleNotFoundError: import pypet2bids.helper_functions as helper_functions - import pypet2bids.is_pet as is_pet + # The import of is_pet is deferred to get_metadata_from_spreadsheet() to + # prevent circular import + #import pypet2bids.is_pet as is_pet import pypet2bids.pet_metadata as metadata # import logging @@ -761,6 +767,12 @@ def get_metadata_from_spreadsheet( :return: dictionary of metadata :rtype: dict """ + # Import is_pet here to avoid circular import + try: + import is_pet + except ModuleNotFoundError: + import pypet2bids.is_pet as is_pet + spreadsheet_metadata = {"nifti_json": {}, "blood_json": {}, "blood_tsv": {}} spreadsheet_values = {} if Path(metadata_path).is_file(): diff --git a/pypet2bids/pyproject.toml b/pypet2bids/pyproject.toml index 6986f92d..ac3d3acd 100644 --- a/pypet2bids/pyproject.toml +++ b/pypet2bids/pyproject.toml @@ -64,8 +64,8 @@ convert-pmod-to-blood = "pypet2bids.convert_pmod_to_blood:main" ispet = "pypet2bids.is_pet:main" updatepetjsonfromdicom = "pypet2bids.dcm2niix4pet:update_json_with_dicom_value_cli" updatepetjsonfromecat = "pypet2bids.ecat_cli:update_json_with_ecat_value_cli" -updatepetjson = "pypet2bids.update_json:update_json_cli" -ecatheaderupdate = "pypet2bids.ecat_header_update:main" +updatepetjson = "pypet2bids.update_json_pet_file:update_json_cli" +ecatheaderupdate = "pypet2bids.ecat_header_update:cli" [project.urls] Documentation = "https://pypet2bids.readthedocs.io/en/latest/" From f1f1bce8c19bea60a4b1516f153c9eacccb7ab26 Mon Sep 17 00:00:00 2001 From: Paul Wighton Date: Thu, 20 Nov 2025 09:50:59 -0500 Subject: [PATCH 2/3] [FIX] unrelated spelling error --- spreadsheet_conversion/Readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spreadsheet_conversion/Readme.md b/spreadsheet_conversion/Readme.md index eda3753d..52f2d769 100644 --- a/spreadsheet_conversion/Readme.md +++ b/spreadsheet_conversion/Readme.md @@ -10,7 +10,7 @@ The example files, show the excel file and the resulting conversion as json. ## 1 spreadsheet for many subjects -In most cases, you subjects are converted (say using dcm2niix) and you need to update the json files with the metadata for all subjects. This is easily acheived using our preformated [scanner excel sheet](https://github.com/openneuropet/PET2BIDS/blob/main/spreadsheet_conversion/many_subjects_sheet/scanner_metadata_template.xlsx) which applies that information to all and the [tracer related excel sheet](https://github.com/openneuropet/PET2BIDS/blob/main/spreadsheet_conversion/many_subjects_sheet/subjects_metadata_template.xlsx). +In most cases, you subjects are converted (say using dcm2niix) and you need to update the json files with the metadata for all subjects. This is easily achieved using our preformated [scanner excel sheet](https://github.com/openneuropet/PET2BIDS/blob/main/spreadsheet_conversion/many_subjects_sheet/scanner_metadata_template.xlsx) which applies that information to all and the [tracer related excel sheet](https://github.com/openneuropet/PET2BIDS/blob/main/spreadsheet_conversion/many_subjects_sheet/subjects_metadata_template.xlsx). ## convert_spreadsheet_metadata.m From fb2fa56b09fc6ec4c6c5d235928f869335ffbe6f Mon Sep 17 00:00:00 2001 From: Anthony Galassi <28850131+bendhouseart@users.noreply.github.com> Date: Fri, 21 Nov 2025 09:33:16 -0500 Subject: [PATCH 3/3] Bump version from 1.4.4 to 1.4.5 --- pypet2bids/pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pypet2bids/pyproject.toml b/pypet2bids/pyproject.toml index ac3d3acd..6f9d22f5 100644 --- a/pypet2bids/pyproject.toml +++ b/pypet2bids/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "pypet2bids" -version = "1.4.4" +version = "1.4.5" description = "A python library for converting PET imaging and blood data to BIDS." authors = [ {name = "anthony galassi", email = "28850131+bendhouseart@users.noreply.github.com"}