InsightSoftwareConsortium / ITKIOFDF

Implement's Glenn Pierce's itk::FDFImageIO as an ITK Remote Module
Apache License 2.0
2 stars 10 forks source link

Issue caused by carriage returns #34

Open jeffduda opened 3 years ago

jeffduda commented 3 years ago

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. \r\n. So when they are parsed and tokenized, there are now 5 tokens, the last being the \r. 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, '\r');" [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.

thewtex commented 3 years ago

@jeffduda PR would be appreciated!

jeffduda commented 3 years ago

Great. I had given up on this and found some work arounds, but would much rather have the fixes implemented here. I'll try to get a PR up in the next week (or two).

thewtex commented 3 years ago

@jeffduda thanks!!