Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions nrrd/reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,9 @@


def _get_field_type(field: str, custom_field_map: Optional[NRRDFieldMap]) -> NRRDFieldType:
if field in ['dimension', 'lineskip', 'line skip', 'byteskip', 'byte skip', 'space dimension']:
if custom_field_map and field in custom_field_map:
return custom_field_map[field]
elif field in ['dimension', 'lineskip', 'line skip', 'byteskip', 'byte skip', 'space dimension']:
return 'int'
elif field in ['min', 'max', 'oldmin', 'old min', 'oldmax', 'old max']:
return 'double'
Expand All @@ -111,9 +113,6 @@ def _get_field_type(field: str, custom_field_map: Optional[NRRDFieldMap]) -> NRR
elif field in ['space directions']:
return 'double matrix'
else:
if custom_field_map and field in custom_field_map:
return custom_field_map[field]

# Default the type to string if unknown type
return 'string'

Expand Down