InsightSoftwareConsortium / InsightSoftwareConsortium/ITK
IOFDF: Issue caused by carriage returns
- Dominant language
- C++
- Stars
- 1.7k
- Forks
- 748
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 64
Description
The `IOFDF` module was ingested into ITK from the (now archived) `ITKIOFDF` remote module. This issue tracks, in ITK proper, the work originally filed as **InsightSoftwareConsortium/ITKIOFDF#34** by @jeffduda (2021-03-23).
---
I've been trying to use the module to read some .fdf files that I have but was getting errors regarding value type. After much debugging I realized that the problem is with the headers. For some reason, each line in the header ends with a carriage return and a new line, i.e.
. So when they are parsed and tokenized, there are now 5 tokens, the last being the
. The code that reads the header then ignores each line as it only looks at lines with exactly 4 items after tokenization. I confirmed that adding the line "line = RemoveCharacters(line, '
');" [here] (https://github.com/InsightSoftwareConsortium/ITKIOFDF/blob/386ac6d55662980d3573a60e97be0447b7eec8fa/src/itkFDFCommonImageIO.cxx#L55-L58) resolves the issue, so I was hoping you could make that fix. I could submit a PR if you would prefer that.
---
Original report: https://github.com/InsightSoftwareConsortium/ITKIOFDF/issues/34 (archived repository). Credit: @jeffduda.
Contributor guide
Assessment
This issue has not been assessed yet.