Freesurfer error FOV > 256

Hi, @oesteban, thanks for your response! I checked our scanning protocol, the actual FoV is 260 mmm but the size are indeed 224 * 320 * 320.

If need to crop the data to 256, which python based tool would you recommend?

Also, @oesteban nd @effigies , after adding --no-submm-recon properly, it seems that I finally finished preprocessing of one participant without error in the report!
Screenshot%20from%202019-03-15%2018-15-38

But I do have an error message in my terminal:

Error in atexit._run_exitfuncs:
Traceback (most recent call last):
  File "/usr/local/miniconda/lib/python3.7/concurrent/futures/process.py", line 101, in _python_exit
    thread_wakeup.wakeup()
  File "/usr/local/miniconda/lib/python3.7/concurrent/futures/process.py", line 89, in wakeup
    self._writer.send_bytes(b"")
  File "/usr/local/miniconda/lib/python3.7/multiprocessing/connection.py", line 183, in send_bytes
    self._check_closed()
  File "/usr/local/miniconda/lib/python3.7/multiprocessing/connection.py", line 136, in _check_closed
    raise OSError("handle is closed")
OSError: handle is closed

You can use nibabel. I would recommend doing this with an interactive session:

from matplotlib import pyplot as plt
import nibabel as nb

img = nb.load('sub-001/ses-d1/anat/sub-001_ses-d1_T1w.nii.gz')
# Check to make sure that the large dimensions are 1 and 2
assert img.shape == (224, 320, 320)

cropped = img.slicer[:, 32:-32, 32:-32]

# Check that you haven't cropped anything important
cropped.orthoview()
# If nothing shows, you may need to then use:
plt.show()

cropped.to_filename('sub-001/ses-d1/anat/sub-001_ses-d1_desc-cropped_T1w.nii.gz')

You can fiddle around with cropping options until you get one you like.

That looks annoying but harmless, to me.

Hi, Chris,
Thanks for your quick response!!

Will try your code here. Just one silly question before I try: will fmriprep automatically recognize the cropped T1w image and use it as the anatomical image in the preprocessing?

No, I don’t believe it will, and if it does, it will try to combine it with your original. So you’ll want to replace it. I’m just not comfortable sending you code to overwrite your data. So if you write directly to that path, I trust you’ll have backups of the original, in case something goes wrong.

2 Likes