Skip to content

Commit 17b0a3c

Browse files
committed
Merge branch 'main' of github.com:openneuropet/PET2BIDS into 319-standardize-radiochemistry-metadata-caseorder
2 parents 0135f6d + 3d39ffb commit 17b0a3c

File tree

12 files changed

+202
-173
lines changed

12 files changed

+202
-173
lines changed

.github/workflows/phantoms.yaml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,6 @@ jobs:
6767
brew install dcm2niix
6868
fi
6969
70-
- name: Debug
71-
uses: mxschmitt/action-tmate@v3
72-
if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled }}
73-
timeout-minutes: 15
74-
with:
75-
limit-access-to-actor: true
7670
7771
- name: Check dcm2niix is installed and on path
7872
if: runner.os != 'Windows'
@@ -106,10 +100,10 @@ jobs:
106100
dcm2niix4pet -h
107101
108102
- name: Set Up Node
109-
uses: actions/setup-node@v3
103+
uses: actions/setup-node@v4
110104

111105
- name: Install BIDS Validator
112-
run: npm install -g bids-validator
106+
run: npm install -g bids-validator@1.14.6
113107

114108
- name: Collect Phantoms
115109
if: ${{ steps.cache-phantoms.outputs.cache-hit != 'true' }} && ${{ !env.ACT }}
@@ -170,6 +164,13 @@ jobs:
170164
run: |
171165
bids-validator OpenNeuroPET-Phantoms/python
172166
167+
- name: Debug
168+
uses: mxschmitt/action-tmate@v3
169+
if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled }}
170+
timeout-minutes: 15
171+
with:
172+
limit-access-to-actor: true
173+
173174
- name: Validate Matlab Conversion
174175
run: |
175176
bids-validator OpenNeuroPET-Phantoms/matlab

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
[![Matlab PET2BIDS Tests](https://github.com/openneuropet/PET2BIDS/actions/workflows/matlab.yaml/badge.svg)](https://github.com/openneuropet/PET2BIDS/actions/workflows/matlab.yaml)
55
[![Documentation Status](https://readthedocs.org/projects/pet2bids/badge/?version=latest)](https://pet2bids.readthedocs.io/en/latest/?badge=latest)
66
[![phantoms](https://github.com/openneuropet/PET2BIDS/actions/workflows/phantoms.yaml/badge.svg)](https://github.com/openneuropet/PET2BIDS/actions/workflows/phantoms.yaml)
7+
[![DOI](https://joss.theoj.org/papers/10.21105/joss.06067/status.svg)](https://doi.org/10.21105/joss.06067)
8+
9+
Galassi, A., Norgaard, M., Gonzalez-Escamilla, G., Svarer, C., Rorden, C., Matheson, G.J, Knudsen, G.M, Innis, R.B., Ganz, M., Eierud, C., Bilgel., M. & Pernet, C. (2024). PET2BIDS: a library for converting Positron Emission Tomography data to BIDS. Journal of Open Source Software, 9(100), 6067.
710

811
This repository is hosting tools to curate PET brain data using the [Brain Imaging Data Structure Specification](https://bids-specification.readthedocs.io/en/stable/04-modality-specific-files/09-positron-emission-tomography.html).
912
The work to create these tools is funded by [Novo Nordisk Foundation](https://novonordiskfonden.dk/en/) (NNF20OC0063277) and the

docs/spreadsheets.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ dedicated to the topic of spreadsheets and PET blood/radioligand/radioactivity d
1414
Handled Types of Spreadsheets (known)
1515
-------------------------------------
1616

17-
`link to repository section <https://github.com/OpenNeuroPET/PET2BIDS/spreadsheet_conversion>`_
17+
`link to repository section <https://github.com/openneuropet/PET2BIDS/tree/main/spreadsheet_conversion>`_
1818

1919
**Excel**
2020

21-
- `Ideal single subject example <https://github.com/OpenNeuroPET/PET2BIDS/spreadsheet_conversion/single_subject_sheet/subject_metadata_example.xlsx>`_
21+
- `Ideal single subject example <https://github.com/openneuropet/PET2BIDS/raw/refs/heads/main/spreadsheet_conversion/single_subject_sheet/subject_metadata_example.xlsx>`_
2222
- Here is an example of a
23-
`Many Subject Spreadsheet <https://github.com/OpenNeuroPET/PET2BIDS/spreadsheet_conversion/many_subjects_sheet/subjects_metadata_example.xlsx>`_
24-
paired with a `single subject spreadsheet <https://github.com/OpenNeuroPET/PET2BIDS/spreadsheet_conversion/many_subjects_sheet/subject_>`_
23+
`Many Subject Spreadsheet <https://github.com/openneuropet/PET2BIDS/raw/refs/heads/main/spreadsheet_conversion/many_subjects_sheet/scanner_metadata_example.xlsx>`_
24+
paired with a `single subject spreadsheet <https://github.com/openneuropet/PET2BIDS/raw/refs/heads/main/spreadsheet_conversion/many_subjects_sheet/subjects_metadata_example.xlsx>`_
2525
these can be used when updating BIDS datasets w/ homogeneous scanner/experiment data along with heterogeneous (subject)
2626
data.
2727

matlab/dcm2niix4pet.m

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ function dcm2niix4pet(FolderList,MetaList,varargin)
3030
% - *w* = 2; % write behavior for name conflicts (0,1,2, default 2: 0=skip duplicates, 1=overwrite, 2=add suffix)
3131
% - *x* = 'n'; % crop 3D acquisitions (y/n/i, default n, use 'i'gnore to neither crop nor rotate 3D acquisitions)
3232
% - *z* = 'n'; % gz compress images (y/o/i/n/3, default y) [y=pigz, o=optimal pigz, i=internal:miniz, n=no, 3=no,3D]
33-
% :param notrack: boolean to Opt-out of sending tracking information of this run to the PET2BIDS developers. This information helps to improve PET2BIDS and provides an indicator of real world usage crucial for obtaining funding."
33+
% - *notrack* Opt-out of sending tracking information of this run to the PET2BIDS developers. This information helps to improve PET2BIDS and provides an indicator of real world usage crucial for obtaining funding."
3434
%
3535
% .. code-block::
3636
%
@@ -69,13 +69,13 @@ function dcm2niix4pet(FolderList,MetaList,varargin)
6969
version = regexp(version_output_string, 'v[0-9].[0-9].{8}[0-9]', 'match');
7070

7171

72-
% initalize telemetry data fror later uploading
72+
% initialize telemetry data fror later uploading
7373
telemetry_data = {};
7474
dcm2niix_data = {};
7575
dcm2niix_data.version = version(1);
7676
dcm2niix_data.returncode = 0;
7777
telemetry_data.dcm2niix = dcm2niix_data;
78-
telemetry_data.description = "Matlab_dcm2niix4pet.m"
78+
telemetry_data.description = "Matlab_dcm2niix4pet.m";
7979

8080
if length(version) >= 1
8181
version_date = version{1}(6:end);
@@ -222,8 +222,6 @@ function dcm2niix4pet(FolderList,MetaList,varargin)
222222
outputdir = varargin{var+1};
223223
elseif strcmpi(varargin{var},'notrack')
224224
setenv('TELEMETRY_ENABLED', 'False')
225-
else
226-
error('unknown option %s',varargin{var})
227225
end
228226

229227
end
@@ -241,8 +239,6 @@ function dcm2niix4pet(FolderList,MetaList,varargin)
241239
end
242240
end
243241

244-
245-
246242
%% convert
247243
% ----------
248244
for folder = 1:size(FolderList,1)
@@ -273,10 +269,8 @@ function dcm2niix4pet(FolderList,MetaList,varargin)
273269
telemetry_data.returncode = 1;
274270
telemetry(telemetry_data, folder);
275271
error('%s did not run properly',command)
276-
277272
end
278-
279-
273+
280274
% deal with dcm files
281275
dcmfiles = dir(fullfile(FolderList{folder},'*.dcm'));
282276
if isempty(dcmfiles) % since sometimes they have no ext :-(

matlab/telemetry.m

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,13 @@ function telemetry(telemetry_data, input_path, output_path)
1818
telemetry_data.TotalInputFileSize = input_file_count.TotalInputFileSize;
1919
end
2020

21-
url = 'http://52.87.154.236/telemetry/';
22-
options = weboptions('MediaType', 'application/json');
23-
response = webwrite(url, telemetry_data, options);
24-
21+
url = 'http://openneuropet.org/pet2bids/';
22+
options = weboptions('MediaType', 'application/json', 'Timeout', 5);
23+
try
24+
response = webwrite(url, telemetry_data, options);
25+
catch ME
26+
% do nothing
27+
end
2528
else
2629
% don't do anything
2730
end
@@ -46,8 +49,11 @@ function telemetry(telemetry_data, input_path, output_path)
4649
end
4750

4851
disable_telemetry = strcmpi(getenv("TELEMETRY_ENABLED"), 'false');
49-
50-
if disable_telemetry | disable_telemetry_env
52+
53+
% if running in CI don't run telemetry
54+
running_in_ci = strcmpi(getenv("CI"), 'true');
55+
56+
if disable_telemetry | disable_telemetry_env | running_in_ci
5157
e = false;
5258
else
5359
e = true;

0 commit comments

Comments
 (0)