I’m trying to read an .fdf file in python. I installed the relevant package via:
pip install itk-iofdf
I then tried the following:
import itk
from itk import IOFDF
x = itk.image_file_reader(filename="M0slice002.fdf" )
which resulted in:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/jtduda/miniconda3/lib/python3.7/site-packages/itk/support/itkHelpers.py", line 211, in image_filter_wrapper
return image_filter(*args, **kwargs)
File "/Users/jtduda/miniconda3/lib/python3.7/site-packages/itk/itkImageFileReaderPython.py", line 5694, in image_file_reader
instance = itk.ImageFileReader.New(*args, **kwargs)
File "/Users/jtduda/miniconda3/lib/python3.7/site-packages/itk/support/itkTemplate.py", line 653, in New
itk.ImageFileReader, False, "FileName", *args, **kwargs
File "/Users/jtduda/miniconda3/lib/python3.7/site-packages/itk/support/itkTemplate.py", line 147, in _NewImageReader
raise RuntimeError("No FileName specified.")
RuntimeError: No FileName specified.
I also tried:
x = itk.image_file_reader(filename="M0slice002.fdf",imageio=itk.FDFImageIO.New() )
which resulted in:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/jtduda/miniconda3/lib/python3.7/site-packages/itk/itkFDFImageIOPython.py", line 118, in New
import itkTemplate
ModuleNotFoundError: No module named 'itkTemplate'
Any advice on how I can use the package to read in an fdf file would be greatly appreciated.