Skip to content

Commit 35d9135

Browse files
committed
Merge branch 'master' into jpeg2000
2 parents 844b88d + 7caff37 commit 35d9135

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+1180
-209
lines changed

.codespellrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[codespell]
2-
skip = .git,.venv,venvs,*.svg,_build
2+
skip = .git,.venv,venvs,*.svg,_build,build
33
# te -- TE as codespell is case insensitive
44
ignore-words-list = bu,nd,te

.github/workflows/lint.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ jobs:
1414
fetch-depth: 0
1515

1616
- name: Set up Python
17-
uses: actions/setup-python@v4
17+
uses: actions/setup-python@v5
1818
with:
19-
python-version: '3.7'
19+
python-version: '3.8'
2020

2121
- name: Install dependencies
2222
run: |

.github/workflows/release.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,24 +19,28 @@ jobs:
1919
- name: Download auto
2020
run: |
2121
#curl -vL -o - "$(curl -fsSL https://api.github.com/repos/intuit/auto/releases/latest | jq -r '.assets[] | select(.name == "auto-linux.gz") | .browser_download_url')" | gunzip > ~/auto
22-
# Pin to 10.16.1 so we don't break if & when
22+
# Pin so we don't break if & when
2323
# <https://github.com/intuit/auto/issues/1778> is fixed.
24-
wget -O- https://github.com/intuit/auto/releases/download/v10.16.1/auto-linux.gz | gunzip > ~/auto
24+
# 11.0.5 is needed for <https://github.com/intuit/auto/issues/2432>
25+
wget -O- https://github.com/intuit/auto/releases/download/v11.0.5/auto-linux.gz | gunzip > ~/auto
2526
chmod a+x ~/auto
2627
27-
- name: Check whether a release is due
28+
- name: Query 'auto' on type of the release
2829
id: auto-version
2930
run: |
30-
version="$(~/auto version)"
31+
# to be able to debug if something goes wrong
32+
set -o pipefail
33+
~/auto version -vv | tee /tmp/auto-version
34+
version="$(sed -ne '/Calculated SEMVER bump:/s,.*: *,,p' /tmp/auto-version)"
3135
echo "version=$version" >> "$GITHUB_OUTPUT"
3236
env:
3337
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3438

3539
- name: Set up Python
3640
if: steps.auto-version.outputs.version != ''
37-
uses: actions/setup-python@v4
41+
uses: actions/setup-python@v5
3842
with:
39-
python-version: '^3.7'
43+
python-version: '^3.8'
4044

4145
- name: Install Python dependencies
4246
if: steps.auto-version.outputs.version != ''

.github/workflows/test.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ jobs:
1414
fail-fast: false
1515
matrix:
1616
python-version:
17-
- '3.7'
1817
- '3.8'
1918
- '3.9'
2019
- '3.10'
@@ -26,7 +25,7 @@ jobs:
2625
fetch-depth: 0
2726

2827
- name: Set up Python
29-
uses: actions/setup-python@v4
28+
uses: actions/setup-python@v5
3029
with:
3130
python-version: ${{ matrix.python-version }}
3231

@@ -54,8 +53,9 @@ jobs:
5453
run: coverage run `which pytest` -s -v heudiconv
5554

5655
- name: Upload coverage to Codecov
57-
uses: codecov/codecov-action@v3
56+
uses: codecov/codecov-action@v4
5857
with:
5958
fail_ci_if_error: false
59+
token: ${{ secrets.CODECOV_TOKEN }}
6060

6161
# vim:set et sts=2:

.github/workflows/typing.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ jobs:
1414
fetch-depth: 0
1515

1616
- name: Set up Python
17-
uses: actions/setup-python@v4
17+
uses: actions/setup-python@v5
1818
with:
19-
python-version: '3.7'
19+
python-version: '3.8'
2020

2121
- name: Install dependencies
2222
run: |

CHANGELOG.md

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,83 @@
1+
# v1.1.0 (Wed Feb 28 2024)
2+
3+
#### 🚀 Enhancement
4+
5+
- Add support for a custom seqinfo to extract from DICOMs any additional metadata desired for a heuristic [#581](https://github.com/nipy/heudiconv/pull/581) ([@yarikoptic](https://github.com/yarikoptic) [@bpinsard](https://github.com/bpinsard))
6+
- codespell: ignore "build" folder which might be on the system [#581](https://github.com/nipy/heudiconv/pull/581) ([@yarikoptic](https://github.com/yarikoptic))
7+
8+
#### Authors: 2
9+
10+
- Basile ([@bpinsard](https://github.com/bpinsard))
11+
- Yaroslav Halchenko ([@yarikoptic](https://github.com/yarikoptic))
12+
13+
---
14+
15+
# v1.0.2 (Mon Feb 26 2024)
16+
17+
#### 🐛 Bug Fix
18+
19+
- properly remove GE multiecho bvals/bvecs [#728](https://github.com/nipy/heudiconv/pull/728) ([@bpinsard](https://github.com/bpinsard))
20+
- datalad sensitive marking fixes [#739](https://github.com/nipy/heudiconv/pull/739) ([@bpinsard](https://github.com/bpinsard))
21+
- Reject "Missing images" in sensor-dicoms [#735](https://github.com/nipy/heudiconv/pull/735) ([@chaselgrove](https://github.com/chaselgrove))
22+
23+
#### ⚠️ Pushed to `master`
24+
25+
- Adding workflow figure ([@TheChymera](https://github.com/TheChymera))
26+
- Added figures to master branch ([@TheChymera](https://github.com/TheChymera))
27+
28+
#### 🏠 Internal
29+
30+
- auto 11.0.5 is needed to avoid hitting some "Error: fatal: ... not an integer" bug [#746](https://github.com/nipy/heudiconv/pull/746) ([@yarikoptic](https://github.com/yarikoptic))
31+
- Fix - auto is in ~/, not in the PATH [#745](https://github.com/nipy/heudiconv/pull/745) ([@yarikoptic](https://github.com/yarikoptic))
32+
- Make it possible to review auto version -v output during release + adjust that workflow step description [#743](https://github.com/nipy/heudiconv/pull/743) ([@yarikoptic](https://github.com/yarikoptic))
33+
- [gh-actions](deps): Bump codecov/codecov-action from 3 to 4 [#736](https://github.com/nipy/heudiconv/pull/736) ([@dependabot[bot]](https://github.com/dependabot[bot]) [@yarikoptic](https://github.com/yarikoptic))
34+
- [gh-actions](deps): Bump actions/setup-python from 4 to 5 [#723](https://github.com/nipy/heudiconv/pull/723) ([@dependabot[bot]](https://github.com/dependabot[bot]))
35+
36+
#### 📝 Documentation
37+
38+
- Adjust wording on heuristics page -- do not claim creating some skeleton [#741](https://github.com/nipy/heudiconv/pull/741) ([@yarikoptic](https://github.com/yarikoptic))
39+
- Document how to release and add changelog entries [#737](https://github.com/nipy/heudiconv/pull/737) ([@asmacdo](https://github.com/asmacdo) [@yarikoptic](https://github.com/yarikoptic))
40+
- Add dianne tutorials [#734](https://github.com/nipy/heudiconv/pull/734) ([@asmacdo](https://github.com/asmacdo) [@yarikoptic](https://github.com/yarikoptic))
41+
- Add documentation building instructions [#730](https://github.com/nipy/heudiconv/pull/730) ([@asmacdo](https://github.com/asmacdo))
42+
- Allowing RTD to access images under the same path as README [#734](https://github.com/nipy/heudiconv/pull/734) ([@TheChymera](https://github.com/TheChymera))
43+
- Using environment figure in about section [#730](https://github.com/nipy/heudiconv/pull/730) ([@TheChymera](https://github.com/TheChymera))
44+
- Make README more concrete [#724](https://github.com/nipy/heudiconv/pull/724) ([@asmacdo](https://github.com/asmacdo))
45+
46+
#### Authors: 6
47+
48+
- [@chaselgrove](https://github.com/chaselgrove)
49+
- [@dependabot[bot]](https://github.com/dependabot[bot])
50+
- Austin Macdonald ([@asmacdo](https://github.com/asmacdo))
51+
- Basile ([@bpinsard](https://github.com/bpinsard))
52+
- Horea Christian ([@TheChymera](https://github.com/TheChymera))
53+
- Yaroslav Halchenko ([@yarikoptic](https://github.com/yarikoptic))
54+
55+
---
56+
57+
# v1.0.1 (Fri Dec 08 2023)
58+
59+
#### 🐛 Bug Fix
60+
61+
- Drop Python 3.7 support [#722](https://github.com/nipy/heudiconv/pull/722) ([@yarikoptic](https://github.com/yarikoptic))
62+
- ReproIn: give an informative assertion message when multiple values are found [#718](https://github.com/nipy/heudiconv/pull/718) ([@yarikoptic](https://github.com/yarikoptic))
63+
- Convert assertion into a warning that we would not use dicom dir template option [#709](https://github.com/nipy/heudiconv/pull/709) ([@yarikoptic](https://github.com/yarikoptic))
64+
- Do not demand --files for all commands, even those which do not care about it (like populate-intended-for) [#708](https://github.com/nipy/heudiconv/pull/708) ([@yarikoptic](https://github.com/yarikoptic))
65+
66+
#### ⚠️ Pushed to `master`
67+
68+
- Add script to sensor dicoms -- for the error where dcm2niix might or might not fail but issues an Error ([@yarikoptic](https://github.com/yarikoptic))
69+
70+
#### 🏠 Internal
71+
72+
- Ran pre-commit on everything, black decided to adjust some formatting [#721](https://github.com/nipy/heudiconv/pull/721) ([@yarikoptic](https://github.com/yarikoptic))
73+
- Make sensor-dicoms use gnu-getopt if present (on OSX) [#721](https://github.com/nipy/heudiconv/pull/721) ([@yarikoptic](https://github.com/yarikoptic))
74+
75+
#### Authors: 1
76+
77+
- Yaroslav Halchenko ([@yarikoptic](https://github.com/yarikoptic))
78+
79+
---
80+
181
# v1.0.0 (Wed Sep 20 2023)
282

383
#### 💥 Breaking Change

CONTRIBUTING.rst

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,33 @@ If you are unsure what that means, here is a set-up workflow you may wish to fol
5151

5252
git push -u origin topic_of_your_contribution
5353

54-
5554
(If any of the above seems overwhelming, you can look up the `Git documentation
5655
<http://git-scm.com/documentation>`_ on the web.)
5756

5857

58+
Releases and Changelog
59+
----------------------
60+
61+
HeuDiConv uses the `auto <https://intuit.github.io/auto/>`_ tool to generate the changelog and automatically release the project.
62+
63+
`auto` is used in the HeuDiConv GitHub actions, which monitors the labels on the pull request.
64+
HeuDiConv automation can add entries to the changelog, cut releases, and
65+
push new images to `dockerhub <https://hub.docker.com/r/nipy/heudiconv>`_.
66+
67+
The following pull request labels are respected:
68+
69+
* major: Increment the major version when merged
70+
* minot: Increment the minot version when merged
71+
* patch: Increment the patch version when merged
72+
* skip-release: Preserve the current version when merged
73+
* release: Create a release when this pr is merged
74+
* internal: Changes only affect the internal API
75+
* documentation: Changes only affect the documentation
76+
* tests: Add or improve existing tests
77+
* dependencies: Update one or more dependencies version
78+
* performance: Improve performance of an existing feature
79+
80+
5981
Development environment
6082
-----------------------
6183

@@ -78,6 +100,18 @@ This is best accomplished via::
78100
pip install -e .[all]
79101

80102

103+
Documentation
104+
-------------
105+
106+
To contribute to the documentation, we recommend building the docs
107+
locally prior to submitting a patch.
108+
109+
To build the docs locally:
110+
111+
1. From the root of the heudiconv repository, `pip install -r docs/requirements.txt`
112+
2. From the `docs/` directory, run `make html`
113+
114+
81115
Additional Hints
82116
----------------
83117

LICENSE

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright [2014-2019] [Heudiconv developers]
1+
Copyright [2014-2024] [HeuDiConv developers]
22

33
Licensed under the Apache License, Version 2.0 (the "License");
44
you may not use this file except in compliance with the License.
@@ -11,3 +11,10 @@ Copyright [2014-2019] [Heudiconv developers]
1111
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
See the License for the specific language governing permissions and
1313
limitations under the License.
14+
15+
16+
Some parts of the codebase/documentation are borrowed from other sources:
17+
18+
- HeuDiConv tutorial from https://bitbucket.org/dpat/neuroimaging_core_docs/src
19+
20+
Copyright 2023 Dianne Patterson

README.rst

Lines changed: 30 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ into structured directory layouts.
5151
- It integrates with `DataLad <https://www.datalad.org/>`_ to place converted and original data under git/git-annex
5252
version control while automatically annotating files with sensitive information (e.g., non-defaced anatomicals, etc).
5353

54+
Heudiconv can be inserted into your workflow to provide automatic conversion as part of a data acquisition pipeline, as seen in the figure below:
55+
56+
.. image:: figs/environment.png
57+
5458
Installation
5559
------------
5660

@@ -60,13 +64,18 @@ on heudiconv.readthedocs.io .
6064
HOWTO 101
6165
---------
6266

63-
In a nutshell -- ``heudiconv`` operates using a heuristic which, given metadata from DICOMs, would decide how to name
64-
resultant (from conversion using `dcm2niix`_) files. Heuristic `convertall <https://github
65-
.com/nipy/heudiconv/blob/master/heudiconv/heuristics/convertall.py>`_ could actually be used with no real
66-
heuristic and by simply establish your own conversion mapping through editing produced mapping files.
67-
In most use-cases of retrospective study data conversion, you would need to create your custom heuristic following
68-
`existing heuristics as examples <https://github.com/nipy/heudiconv/tree/master/heudiconv/heuristics>`_ and/or
69-
referring to `"Heuristic" section <https://heudiconv.readthedocs.io/en/latest/heuristics.html>`_ in the documentation.
67+
In a nutshell -- ``heudiconv`` is given a file tree of DICOMs, and it produces a restructured file tree of NifTI files (conversion handled by `dcm2niix`_) with accompanying metadata files.
68+
The input and output structure is as flexible as your data, which is accomplished by using a Python file called a ``heuristic`` that knows how to read your input structure and decides how to name the resultant files.
69+
You can run your conversion automatically (which will produce a ``.heudiconv`` directory storing the used parameters), or generate the default parameters, edit them to customize file naming, and continue conversion via an additional invocation of `heudiconv`:
70+
71+
.. image:: figs/workflow.png
72+
73+
74+
``heudiconv`` comes with `existing heuristics <https://github.com/nipy/heudiconv/tree/master/heudiconv/heuristics>`_ which can be used as is, or as examples.
75+
For instance, the Heuristic `convertall <https://github.com/nipy/heudiconv/blob/master/heudiconv/heuristics/convertall.py>`_ extracts standard metadata from all matching DICOMs.
76+
``heudiconv`` creates mapping files, ``<something>.edit.text`` which lets researchers simply establish their own conversion mapping.
77+
78+
In most use-cases of retrospective study data conversion, you would need to create your custom heuristic following the examples and the `"Heuristic" section <https://heudiconv.readthedocs.io/en/latest/heuristics.html>`_ in the documentation.
7079
**Note** that `ReproIn heuristic <https://github.com/nipy/heudiconv/blob/master/heudiconv/heuristics/reproin.py>`_ is
7180
generic and powerful enough to be adopted virtually for *any* study: For prospective studies, you would just need
7281
to name your sequences following the `ReproIn convention <https://github.com/nipy/heudiconv/blob/master/heudiconv/heuristics/reproin.py#L26>`_, and for
@@ -106,3 +115,17 @@ Docker image preparation being found in ``.github/workflows/release.yml``.
106115
---------------------
107116

108117
- https://github.com/courtois-neuromod/ds_prep/blob/main/mri/convert/heuristics_unf.py
118+
119+
120+
Support
121+
-------
122+
123+
All bugs, concerns and enhancement requests for this software can be submitted here:
124+
https://github.com/nipy/heudiconv/issues.
125+
126+
If you have a problem or would like to ask a question about how to use ``heudiconv``,
127+
please submit a question to `NeuroStars.org <http://neurostars.org/tags/heudiconv>`_ with a ``heudiconv`` tag.
128+
NeuroStars.org is a platform similar to StackOverflow but dedicated to neuroinformatics.
129+
130+
All previous ``heudiconv`` questions are available here:
131+
http://neurostars.org/tags/heudiconv/

docs/commandline.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
=============
2+
CLI Reference
3+
=============
4+
5+
``heudiconv`` processes DICOM files and converts the output into user defined
6+
paths.
7+
8+
.. argparse::
9+
:ref: heudiconv.cli.run.get_parser
10+
:prog: heudiconv
11+
:nodefault:
12+
:nodefaultconst:

0 commit comments

Comments
 (0)