Commit 28f52e6
ENH: Use lossless float serialization in SpatialObject and Mesh IO
Two persistence-layer paths used lossy default stream precision for
floating-point coordinates:
itkPolygonGroupSpatialObjectXMLFile.cxx: PolygonSpatialObject vertex
coordinates (Point<double,3>) were streamed to the XML file with default
6-digit precision. Replace with itk::ConvertNumberToString() per component.
itkFreeSurferAsciiMeshIO.h WritePoints<T>: hardcoded precision(6) with
std::fixed limited output to 6 decimal places regardless of T. Replace
with std::numeric_limits<T>::max_digits10 and remove std::fixed so that
both float and double specializations produce shortest-round-trip output.
See: #3249
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent 2bfe6ae commit 28f52e6
2 files changed
Lines changed: 6 additions & 3 deletions
File tree
- Modules/IO
- MeshFreeSurfer/include
- SpatialObjects/src
Lines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
| |||
117 | 118 | | |
118 | 119 | | |
119 | 120 | | |
120 | | - | |
| 121 | + | |
121 | 122 | | |
122 | 123 | | |
123 | 124 | | |
124 | 125 | | |
125 | 126 | | |
126 | | - | |
| 127 | + | |
127 | 128 | | |
128 | 129 | | |
129 | 130 | | |
| |||
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| |||
253 | 254 | | |
254 | 255 | | |
255 | 256 | | |
256 | | - | |
| 257 | + | |
| 258 | + | |
257 | 259 | | |
258 | 260 | | |
259 | 261 | | |
| |||
0 commit comments