coveralls: 
[![Coverage Status](https://coveralls.io/builds/14003998/badge)](https://coveralls.io/builds/14003998)

Coverage increased (+0.05%) to 81.017% when pulling **b2195c51696b5c0198e491351886561d1d687103 on 90_image_resample** into **758a6d0d41dd61617d6957ae400a7b0c366b477b on master**.

diff --git a/suspect/base.py b/suspect/base.py
index 6952aa2..8be873b 100644
--- a/suspect/base.py
+++ b/suspect/base.py
@@ -122,12 +122,12 @@ class ImageBase(np.ndarray):
     @property
     @requires_transform
     def row_vector(self):
-        return self.transform[:3, 1] / np.linalg.norm(self.transform[:3, 1])
+        return self.transform[:3, 0] / np.linalg.norm(self.transform[:3, 0])
 
     @property
     @requires_transform
     def col_vector(self):
-        return self.transform[:3, 0] / np.linalg.norm(self.transform[:3, 0])
+        return self.transform[:3, 1] / np.linalg.norm(self.transform[:3, 1])
 
     @requires_transform
     def _closest_axis(self, target_axis):
@@ -264,12 +264,13 @@ class ImageBase(np.ndarray):
                        + JJ[..., np.newaxis] * col_vector \
                        + KK[..., np.newaxis] * slice_vector + centre
 
+        image_coords = self.from_scanner(space_coords).reshape(*space_coords.shape)[..., ::-1].astype(np.int)
         resampled = scipy.interpolate.interpn([np.arange(dim) for dim in self.shape],
                                               self,
-                                              self.from_scanner(space_coords)[..., ::-1],
+                                              image_coords,
                                               method=method,
                                               bounds_error=False,
-                                              fill_value=0)
+                                              fill_value=0).squeeze()
 
         transform = _transforms.transformation_matrix(row_vector,
                                                       col_vector,

BUG: resampling of image volumes doesn't work properly for single slices
When transforming coordinates the arrays are squeezed which can remove singlet spatial dimensions, leading to issues in interpreting the coordinate arrays.
diff --git a/tests/test_mrs/test_base.py b/tests/test_mrs/test_base.py
index 72a8d6d..d5e437a 100644
--- a/tests/test_mrs/test_base.py
+++ b/tests/test_mrs/test_base.py
@@ -55,8 +55,8 @@ def test_find_axes():
                                                   [1, 1, 1])
     base = suspect.base.ImageBase(np.zeros(1), transform=transform)
     np.testing.assert_equal(base.axial_vector, base.slice_vector)
-    np.testing.assert_equal(base.coronal_vector, base.row_vector)
-    np.testing.assert_equal(base.sagittal_vector, base.col_vector)
+    np.testing.assert_equal(base.coronal_vector, base.col_vector)
+    np.testing.assert_equal(base.sagittal_vector, base.row_vector)
 
 
 def test_find_axes_reversed():
@@ -66,8 +66,8 @@ def test_find_axes_reversed():
                                                   [1, 1, 1])
     base = suspect.base.ImageBase(np.zeros(1), transform=transform)
     np.testing.assert_equal(base.axial_vector, base.slice_vector)
-    np.testing.assert_equal(base.coronal_vector, -base.row_vector)
-    np.testing.assert_equal(base.sagittal_vector, -base.col_vector)
+    np.testing.assert_equal(base.coronal_vector, -base.col_vector)
+    np.testing.assert_equal(base.sagittal_vector, -base.row_vector)
 
 
 def test_centre():
diff --git a/tests/test_mrs/test_image.py b/tests/test_mrs/test_image.py
index d1a760c..128bd97 100644
--- a/tests/test_mrs/test_image.py
+++ b/tests/test_mrs/test_image.py
@@ -32,3 +32,13 @@ def test_nifti_io():
     nifti_volume = suspect.image.load_nifti("tests/test_data/tmp/nifti.nii")
     np.testing.assert_equal(dicom_volume, nifti_volume)
     np.testing.assert_allclose(dicom_volume.transform, nifti_volume.transform)
+
+
+def test_resample_single_slice():
+    source_volume = suspect.base.ImageBase(np.random.random((20, 20, 20)), transform=np.eye(4))
+    slc = source_volume.resample(source_volume.row_vector,
+                                 source_volume.col_vector,
+                                 [1, 20, 10],
+                                 centre=(5, 10, 0))
+    assert slc.shape == (20, 10)
+    np.testing.assert_equal(source_volume[0, :, :10], slc)

pip install -e .
parse_log_pytest
requirements.txt
pytest pytest-cov
3.5
requirements.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
alabaster==0.7.13
asteval==0.9.26
async-generator==1.10
attrs==22.2.0
Babel==2.11.0
backcall==0.2.0
bleach==4.1.0
certifi==2021.5.30
charset-normalizer==2.0.12
coverage==6.2
decorator==5.1.1
defusedxml==0.7.1
docutils==0.18.1
entrypoints==0.4
future==1.0.0
idna==3.10
imagesize==1.4.1
importlib-metadata==4.8.3
iniconfig==1.1.1
ipykernel==5.5.6
ipython==7.16.3
ipython-genutils==0.2.0
jedi==0.17.2
Jinja2==3.0.3
jsonschema==3.2.0
jupyter-client==7.1.2
jupyter-core==4.9.2
jupyterlab-pygments==0.1.2
lmfit==1.0.3
MarkupSafe==2.0.1
mistune==0.8.4
nbclient==0.5.9
nbconvert==6.0.7
nbformat==5.1.3
nbsphinx==0.8.8
nest-asyncio==1.6.0
nibabel==3.2.2
numpy==1.19.5
packaging==21.3
pandocfilters==1.5.1
parse==1.20.2
Parsley==1.3
parso==0.7.1
pexpect==4.9.0
pickleshare==0.7.5
pluggy==1.0.0
prompt-toolkit==3.0.36
ptyprocess==0.7.0
py==1.11.0
pydicom==2.3.1
Pygments==2.14.0
pyparsing==3.1.4
pyrsistent==0.18.0
pytest==7.0.1
pytest-cov==4.0.0
python-dateutil==2.9.0.post0
pytz==2025.2
PyWavelets==1.1.1
pyzmq==25.1.2
requests==2.27.1
scipy==1.5.4
six==1.17.0
snowballstemmer==2.2.0
Sphinx==5.3.0
sphinxcontrib-applehelp==1.0.2
sphinxcontrib-devhelp==1.0.2
sphinxcontrib-htmlhelp==2.0.0
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==1.0.3
sphinxcontrib-serializinghtml==1.1.5
-e git+https://github.com/openmrslab/suspect.git@758a6d0d41dd61617d6957ae400a7b0c366b477b#egg=suspect
testpath==0.6.0
tomli==1.2.3
tornado==6.1
traitlets==4.3.3
typing_extensions==4.1.1
uncertainties==3.1.7
urllib3==1.26.20
wcwidth==0.2.13
webencodings==0.5.1
zipp==3.6.0

name: suspect
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - certifi=2021.5.30=py36h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.3=he6710b0_2
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=1.1.1w=h7f8727e_0
  - pip=21.2.2=py36h06a4308_0
  - python=3.6.13=h12debd9_1
  - readline=8.2=h5eee18b_0
  - setuptools=58.0.4=py36h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - wheel=0.37.1=pyhd3eb1b0_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - alabaster==0.7.13
      - asteval==0.9.26
      - async-generator==1.10
      - attrs==22.2.0
      - babel==2.11.0
      - backcall==0.2.0
      - bleach==4.1.0
      - charset-normalizer==2.0.12
      - coverage==6.2
      - decorator==5.1.1
      - defusedxml==0.7.1
      - docutils==0.18.1
      - entrypoints==0.4
      - future==1.0.0
      - idna==3.10
      - imagesize==1.4.1
      - importlib-metadata==4.8.3
      - iniconfig==1.1.1
      - ipykernel==5.5.6
      - ipython==7.16.3
      - ipython-genutils==0.2.0
      - jedi==0.17.2
      - jinja2==3.0.3
      - jsonschema==3.2.0
      - jupyter-client==7.1.2
      - jupyter-core==4.9.2
      - jupyterlab-pygments==0.1.2
      - lmfit==1.0.3
      - markupsafe==2.0.1
      - mistune==0.8.4
      - nbclient==0.5.9
      - nbconvert==6.0.7
      - nbformat==5.1.3
      - nbsphinx==0.8.8
      - nest-asyncio==1.6.0
      - nibabel==3.2.2
      - numpy==1.19.5
      - packaging==21.3
      - pandocfilters==1.5.1
      - parse==1.20.2
      - parsley==1.3
      - parso==0.7.1
      - pexpect==4.9.0
      - pickleshare==0.7.5
      - pluggy==1.0.0
      - prompt-toolkit==3.0.36
      - ptyprocess==0.7.0
      - py==1.11.0
      - pydicom==2.3.1
      - pygments==2.14.0
      - pyparsing==3.1.4
      - pyrsistent==0.18.0
      - pytest==7.0.1
      - pytest-cov==4.0.0
      - python-dateutil==2.9.0.post0
      - pytz==2025.2
      - pywavelets==1.1.1
      - pyzmq==25.1.2
      - requests==2.27.1
      - scipy==1.5.4
      - six==1.17.0
      - snowballstemmer==2.2.0
      - sphinx==5.3.0
      - sphinxcontrib-applehelp==1.0.2
      - sphinxcontrib-devhelp==1.0.2
      - sphinxcontrib-htmlhelp==2.0.0
      - sphinxcontrib-jsmath==1.0.1
      - sphinxcontrib-qthelp==1.0.3
      - sphinxcontrib-serializinghtml==1.1.5
      - testpath==0.6.0
      - tomli==1.2.3
      - tornado==6.1
      - traitlets==4.3.3
      - typing-extensions==4.1.1
      - uncertainties==3.1.7
      - urllib3==1.26.20
      - wcwidth==0.2.13
      - webencodings==0.5.1
      - zipp==3.6.0
prefix: /opt/conda/envs/suspect

tests/test_mrs/test_base.py::test_find_axes tests/test_mrs/test_base.py::test_find_axes_reversed tests/test_mrs/test_image.py::test_resample_single_slice
tests/test_mrs/test_base.py::test_create_base tests/test_mrs/test_base.py::test_base_transform tests/test_mrs/test_base.py::test_transforms_fail tests/test_mrs/test_base.py::test_centre tests/test_mrs/test_base.py::test_resample tests/test_mrs/test_image.py::test_simple_mask tests/test_mrs/test_image.py::test_nifti_io
suspect/base.py
suspect/base.py