[ITK] [ITK-dev] Proposal: file reader API additions to eliminate need for guessing pair file paths

Sean McBride sean at rogue-research.com
Fri Jan 8 14:00:55 EST 2016


Hi all,

Some (annoying) file formats like Analyze and PhilipsREC come in pairs: one metadata file and one data file, ex: .hdr & .img and .par & .rec.

The reader classes currently take the path to one of the files and then auto-guess/construct the other path.  Of course this works most of the time, but is fragile for a few reasons:

 - the file name parsing code assumes ASCII.
 - the code has to guess the case of the pair file.  ex, if you provide foo.HDR, it has to guess either .img or .IMG, and this may succeed or fail depending if the file system is case sensitive or not.  To say nothing of users maybe having mixed case names like "foo.imG".
 - OSes these days often sandbox access to the file system and this guessing around of paths can cause sandbox violations (which could be merely warnings or errors depending on OS).

I'd like to propose new API for such file readers, specifically that clients can pass the path to *both* files.  Then no fragile is guessing is needed.  We wouldn't need to change existing API, merely add new ones.

But before starting, I'd like to know if this would be accepted...

Thanks,

-- 
____________________________________________________________
Sean McBride, B. Eng                 sean at rogue-research.com
Rogue Research                        www.rogue-research.com 
Mac Software Developer              Montréal, Québec, Canada


_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html

Kitware offers ITK Training Courses, for more information visit:
http://kitware.com/products/protraining.php

Please keep messages on-topic and check the ITK FAQ at:
http://www.itk.org/Wiki/ITK_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/insight-developers


More information about the Community mailing list