diff --git a/heudiconv/heuristics/reproin.py b/heudiconv/heuristics/reproin.py
index 4829941..e26356e 100644
--- a/heudiconv/heuristics/reproin.py
+++ b/heudiconv/heuristics/reproin.py
@@ -551,7 +551,10 @@ def infotodict(seqinfo):
             if not dcm_image_iod_spec:
                 raise ValueError("Do not know image data type yet to make decision")
             seqtype_label = {
-                'M': 'magnitude',  # might want explicit {file_index}  ?
+                # might want explicit {file_index}  ?
+                # _epi for pipolar fieldmaps, see
+                # https://bids-specification.readthedocs.io/en/stable/04-modality-specific-files/01-magnetic-resonance-imaging-data.html#case-4-multiple-phase-encoded-directions-pepolar
+                'M': 'epi' if 'dir' in series_info else 'magnitude',
                 'P': 'phasediff',
                 'DIFFUSION': 'epi', # according to KODI those DWI are the EPIs we need
             }[dcm_image_iod_spec]
@@ -610,12 +613,23 @@ def infotodict(seqinfo):
         if s.is_motion_corrected and 'rec-' in series_info.get('bids', ''):
             raise NotImplementedError("want to add _acq-moco but there is _acq- already")
 
+        def from_series_info(name):
+            """A little helper to provide _name-value if series_info knows it
+
+            Returns None otherwise
+            """
+            if series_info.get(name):
+                return "%s-%s" % (name, series_info[name])
+            else:
+                return None
+
         suffix_parts = [
-            None if not series_info.get('task') else "task-%s" % series_info['task'],
-            None if not series_info.get('acq') else "acq-%s" % series_info['acq'],
+            from_series_info('task'),
+            from_series_info('acq'),
             # But we want to add an indicator in case it was motion corrected
             # in the magnet. ref sample  /2017/01/03/qa
             None if not s.is_motion_corrected else 'rec-moco',
+            from_series_info('dir'),
             series_info.get('bids'),
             run_label,
             seqtype_label,
@@ -903,7 +917,7 @@ def parse_series_spec(series_spec):
             .replace('_', 'X').replace('-', 'X') \
             .replace('(', '{').replace(')', '}')  # for Philips
 
-        if key in ['ses', 'run', 'task', 'acq']:
+        if key in ['ses', 'run', 'task', 'acq', 'dir']:
             # those we care about explicitly
             regd[{'ses': 'session'}.get(key, key)] = sanitize_str(value)
         else:

Support pepolar fmaps
Not yet sure if might be reproin heuristic specific. ATM for SE sequences intended to be pepolar fieldmaps https://bids-specification.readthedocs.io/en/stable/04-modality-specific-files/01-magnetic-resonance-imaging-data.html#case-4-multiple-phase-encoded-directions-pepolar we are getting files with `_magnitude` suffix, whenever it should be `_epi`.

Attn @amanelis17
diff --git a/heudiconv/heuristics/test_reproin.py b/heudiconv/heuristics/test_reproin.py
index 0a63dc1..a995e39 100644
--- a/heudiconv/heuristics/test_reproin.py
+++ b/heudiconv/heuristics/test_reproin.py
@@ -208,4 +208,7 @@ def test_parse_series_spec():
     # from (date) since Philips does not allow for {}
     assert pdpn("func_ses-{date}") == \
            pdpn("func_ses-(date)") == \
-           {'seqtype': 'func', 'session': '{date}'}
\ No newline at end of file
+           {'seqtype': 'func', 'session': '{date}'}
+
+    assert pdpn("fmap_dir-AP_ses-01") == \
+           {'seqtype': 'fmap', 'session': '01', 'dir': 'AP'}
\ No newline at end of file

pip install -e .[all]
parse_log_pytest
requirements.txt
pytest tinydb inotify
apt-get update apt-get install -y gcc
3.6
requirements.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
annexremote==1.6.6
appdirs==1.4.4
attrs==22.2.0
boto==2.49.0
certifi==2021.5.30
cffi==1.15.1
chardet==5.0.0
charset-normalizer==2.0.12
ci-info==0.2.0
click==8.0.4
cryptography==40.0.2
datalad==0.15.6
dcmstack==0.9.0
decorator==4.4.2
Deprecated==1.2.18
etelemetry==0.2.2
fasteners==0.19
filelock==3.4.1
-e git+https://github.com/nipy/heudiconv.git@5357359f618a46dba7e4e55febf4e901a59f4523#egg=heudiconv
humanize==3.14.0
idna==3.10
importlib-metadata==4.8.3
importlib-resources==5.4.0
iniconfig==1.1.1
inotify==0.2.10
iso8601==1.1.0
isodate==0.6.1
jeepney==0.7.1
keyring==23.4.1
keyrings.alt==4.1.0
lxml==5.3.1
mock==5.2.0
msgpack==1.0.5
networkx==2.5.1
nibabel==3.2.2
nipype==1.7.1
nose==1.3.7
numpy==1.19.5
packaging==21.3
pathlib==1.0.1
patool==1.12
pluggy==1.0.0
prov==2.0.1
py==1.11.0
pycparser==2.21
pydicom==2.3.1
pydot==1.4.2
PyGithub==1.56
PyJWT==2.4.0
PyNaCl==1.5.0
pyparsing==3.1.4
pytest==7.0.1
python-dateutil==2.9.0.post0
python-gitlab==2.10.1
rdflib==5.0.0
requests==2.27.1
requests-toolbelt==1.0.0
scipy==1.5.4
SecretStorage==3.3.3
simplejson==3.20.1
six==1.17.0
swebench-matterhorn @ file:///swebench_matterhorn
tinydb==4.7.0
tomli==1.2.3
tqdm==4.64.1
traits==6.4.1
typing_extensions==4.1.1
urllib3==1.26.20
Whoosh==2.7.4
wrapt==1.16.0
zipp==3.6.0

name: heudiconv
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:
      - annexremote==1.6.6
      - appdirs==1.4.4
      - attrs==22.2.0
      - boto==2.49.0
      - cffi==1.15.1
      - chardet==5.0.0
      - charset-normalizer==2.0.12
      - ci-info==0.2.0
      - click==8.0.4
      - cryptography==40.0.2
      - datalad==0.15.6
      - dcmstack==0.9.0
      - decorator==4.4.2
      - deprecated==1.2.18
      - etelemetry==0.2.2
      - fasteners==0.19
      - filelock==3.4.1
      - humanize==3.14.0
      - idna==3.10
      - importlib-metadata==4.8.3
      - importlib-resources==5.4.0
      - iniconfig==1.1.1
      - inotify==0.2.10
      - iso8601==1.1.0
      - isodate==0.6.1
      - jeepney==0.7.1
      - keyring==23.4.1
      - keyrings-alt==4.1.0
      - lxml==5.3.1
      - mock==5.2.0
      - msgpack==1.0.5
      - networkx==2.5.1
      - nibabel==3.2.2
      - nipype==1.7.1
      - nose==1.3.7
      - numpy==1.19.5
      - packaging==21.3
      - pathlib==1.0.1
      - patool==1.12
      - pluggy==1.0.0
      - prov==2.0.1
      - py==1.11.0
      - pycparser==2.21
      - pydicom==2.3.1
      - pydot==1.4.2
      - pygithub==1.56
      - pyjwt==2.4.0
      - pynacl==1.5.0
      - pyparsing==3.1.4
      - pytest==7.0.1
      - python-dateutil==2.9.0.post0
      - python-gitlab==2.10.1
      - rdflib==5.0.0
      - requests==2.27.1
      - requests-toolbelt==1.0.0
      - scipy==1.5.4
      - secretstorage==3.3.3
      - simplejson==3.20.1
      - six==1.17.0
      - swebench-matterhorn==0.0.0
      - tinydb==4.7.0
      - tomli==1.2.3
      - tqdm==4.64.1
      - traits==6.4.1
      - typing-extensions==4.1.1
      - urllib3==1.26.20
      - whoosh==2.7.4
      - wrapt==1.16.0
      - zipp==3.6.0
prefix: /opt/conda/envs/heudiconv

heudiconv/heuristics/test_reproin.py::test_parse_series_spec
heudiconv/heuristics/test_reproin.py::test_get_dups_marked heudiconv/heuristics/test_reproin.py::test_filter_files heudiconv/heuristics/test_reproin.py::test_md5sum heudiconv/heuristics/test_reproin.py::test_fix_canceled_runs heudiconv/heuristics/test_reproin.py::test_fix_dbic_protocol heudiconv/heuristics/test_reproin.py::test_sanitize_str heudiconv/heuristics/test_reproin.py::test_fixupsubjectid
heudiconv/heuristics/reproin.py
heudiconv/heuristics/reproin.py