Skip to content

Commit

Permalink
[ENH] Update pet2bids version and fix 4D singleton dimension issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan Levitas committed Feb 20, 2024
1 parent 153b7e0 commit 4dc3d28
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion handler/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ RUN apt update && \
RUN apt install -y parallel python3 python3-pip tree curl unzip git jq python libgl-dev python-numpy

RUN pip3 install numpy==1.23.0 nibabel==4.0.0 pandas==1.0.1 matplotlib pyyaml==5.4.1 pydicom==2.3.1 natsort pydeface && \
pip3 install quickshear pypet2bids==1.3.2 mne mne-bids
pip3 install quickshear pypet2bids==1.3.5 mne mne-bids

RUN apt-get install -y build-essential pkg-config cmake git pigz rename zstd libopenjp2-7 libgdcm-tools wget libopenblas-dev && \
apt-get clean -y && apt-get autoclean -y && apt-get autoremove -y
Expand Down
8 changes: 7 additions & 1 deletion handler/ezBIDS_core/createThumbnailsMovies.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,13 @@ def create_thumbnail(img_file, image):
"""

if image.ndim == 4:
object_img_array = image.dataobj[..., 1]
try:
object_img_array = image.dataobj[..., 1]
except:
# weird issue where an improper singleton 4D dimension is added for otherwise 3D data (see with PET)
image = nib.funcs.squeeze_image(image)
object_img_array = image.dataobj[:]
image.to_filename(img_file)
else:
object_img_array = image.dataobj[:]

Expand Down

0 comments on commit 4dc3d28

Please sign in to comment.