InsightSoftwareConsortium / InsightSoftwareConsortium/ITK

ImageIO check format support in two phases

Open
#1,410 1 comment 0 reactions 0 assignees View on GitHub
area:IO type:Enhancement
Dominant language
C++
Stars
1.7k
Forks
748
Avg merge
1d 1h
Merged PRs (30d)
64

Description

### Description

The way the IO factory works is that for every ImageIO it is constructed and then "CanRead" is called to determine if it's the correct one to use. If every ImageIO open the file, checks, and closes the file it will slow down this process ( consider network or remote files ).

### Expected behavior

There have been recent improvements for the ImageIOs to report the extensions it can read. To pursue this feature further I'd recommend making the IO Factory construction two passes:

1. Check the extension of the file is supported for each IO, if found then use that ImageIO.
1. Then check the CanRead method which may open the file.

### Additional Information

Suggested by @blowekamp in #1407.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.