IOFDF: Issue caused by carriage returns
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 76/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- cpp
- Domain
- computer-vision
Research direction
Start with src/itkFDFCommonImageIO.cxx at the cited header-parsing lines and inspect how CRLF-terminated .fdf header lines are tokenized. Reproduce the reported value-type failure with a file using carriage returns, then verify that the header is parsed correctly and the image can be read.
Written by the indexing model from the issue text.
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.
- Dominant language
- C++
- Stars
- 1.7k
- Forks
- 749
- Avg merge
- 1d 4h
- Merged PRs (30d)
- 57
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from InsightSoftwareConsortium/ITK
-
type:Infrastructure
Difficulty 1/5 Under an hour Newbie friendliness 90/100
InsightSoftwareConsortium/ITK#6754 · 2 reactions ·
-
area:Documentation type:Documentation
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
InsightSoftwareConsortium/ITK#6752 ·
-
area:IO type:Testing
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
InsightSoftwareConsortium/ITK#6750 ·
-
area:Documentation type:Documentation
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
InsightSoftwareConsortium/ITK#6744 · 1 reaction ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
InsightSoftwareConsortium/ITK#6390 · 2 comments ·
All issues in InsightSoftwareConsortium/ITK
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
AXERA-TECH/ax-llm#77 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
bug-unconfirmed
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
NVIDIA/cuda-samples#453 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
infiniflow/infinity#3502 ·