Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions pypet2bids/pypet2bids/ecat_header_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
16 changes: 14 additions & 2 deletions pypet2bids/pypet2bids/update_json_pet_file.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env python3

from pathlib import Path
from os.path import join
from os import listdir
Expand All @@ -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
Expand Down Expand Up @@ -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():
Expand Down
6 changes: 3 additions & 3 deletions pypet2bids/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "[email protected]"}
Expand Down Expand Up @@ -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/"
Expand Down
2 changes: 1 addition & 1 deletion spreadsheet_conversion/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Loading