[Insight-developers] One possible framework for Image I/O...

Will Schroeder will.schroeder@kitware.com
Tue, 19 Dec 2000 10:15:38 -0500


--=====================_153339851==_.ALT
Content-Type: text/plain; charset="us-ascii"; format=flowed

Hi Parag-

Bill Hoffman and I have looked over the code. We're thinking that a three-step
clean-up is in order.

1. Clean style
2. Use New(), not little new.
3. Integration with itkObjectFactory.

Bill Hoffman will be sending his thoughts on #3. There are some really
good ideas in the code that we want to take advantage of.

As far as the style #1 goes: there are several problems we need to clean up.
- Indentation should be two spaces, not more, and please don't use tabs.
- Use {} braces around the body of for loops, if's, etc.
    for ()
      {
      }
    if ()
      {
      }

As far as #2:
your example has:

         myFilterType::Pointer filter = new 
myFilterType("D:/research/Angio002Series005.mhd");

The constructor/destructor is protected. New() should be used. This means 
you'll have to do:

         myFilterType::Pointer filter = myFilterType::New();
         filter->SetFileName("D:/research/Angio002Series005.mhd");

It'd be great if you can address #1 and #2 and check it in. Then we can 
work together to get #3.

Will




At 04:03 PM 12/17/00 -0500, you wrote:
>Hello,
>I have checked in a number of files that are part of an image I/O 
>framework we are developing here at UNC. For anyone that is interested in 
>I/O matters and this candidate framework, I suggest as a starting point 
>the following article on Pluggable Object Factories at C++ Report:
>
><http://www.creport.com/html/from_pages/view_recent_articles_c.cfm?ArticleID=1520>http://www.creport.com/html/from_pages/view_recent_articles_c.cfm?ArticleID=1520
>
>My own article, ImageIO.html (in the documents directory of the 
>repository), then describes how to leverage this concept for file I/O.
>
>Please note that before checking in these new files, I performed a CVS 
>checkout in a new directory at 1:45 PM on 12/17. I was unable to build the 
>existing code successfully on any platform other than VisualC++ (Linux, 
>SunOS, SGI all fail), and so I am unable to verify that my new files are 
>cross-platform compatible with respect to the latest state of the 
>repository. Therefore, I have refrained from making these new files part 
>of the build process for the time being, and have not modified any of the 
>CMakeLists. So I don't anticipate my changes to cause any problems, but 
>please let me know as soon as possible if they do in fact break something; 
>I'll be checking e-mail frequently while on vacation for the next three weeks.
>
>Below is a list of all the new files I added, along w/ very brief 
>descriptions of the classes:
>
>Under Code/Common:
>itkMaker.h
>itkMaker.txx - pluggable object factory base class. templated over key 
>type and object type
>itkFileIOCommon.h
>itkFileIOCommon.cxx
>itkFileIO.h
>itkFileIO.cxx - image i/o base class. does little more than define an 
>interface and an abstract object factory
>itkFilterFileIOToImage.h
>itkFilterFileIOToImage.txx - base class for transferring image data from a 
>FileIO to an Image
>itkIntTypes.h - defines the integer types for cross-platform 
>compatibility. probably not needed
>
>Under Code/Interfaces/MetaImage:
>itkFileIOMetaImageCommon.h
>itkFileIOMetaImageCommon.cxx
>itkFileIOMetaImage.h
>itkFileIOMetaImage.cxx - one concrete implementation of a FileIO and 
>factory to illustrate the framework.
>Under Testing/Code/Common:
>itkFileIOTest.cxx - uses FileIOMetaImage, Image<>, and FilterFileIOToImage 
>to illustrate the API presented to developer
>
>Under Documents:
>ImageIO1.jpg
>ImageIO.html - article describing the framework
>
>I welcome your comments and suggestions, and hope that some of these ideas 
>will prove to be useful in the final I/O framework.
>
>Thanks,
>-Parag Chandra

--=====================_153339851==_.ALT
Content-Type: text/html; charset="us-ascii"

Hi Parag-

Bill Hoffman and I have looked over the code. We're thinking that a three-step
clean-up is in order.

1. Clean style
2. Use New(), not little new.
3. Integration with itkObjectFactory.

Bill Hoffman will be sending his thoughts on #3. There are some really
good ideas in the code that we want to take advantage of.

As far as the style #1 goes: there are several problems we need to clean up.
- Indentation should be two spaces, not more, and please don't use tabs.
- Use {} braces around the body of for loops, if's, etc.
   for ()
     {
     }
   if ()
     {
     }

As far as #2:
your example has:

        myFilterType::Pointer filter = new myFilterType("D:/research/Angio002Series005.mhd");

The constructor/destructor is protected. New() should be used. This means you'll have to do:

        myFilterType::Pointer filter = myFilterType::New();
        filter->SetFileName("D:/research/Angio002Series005.mhd");

It'd be great if you can address #1 and #2 and check it in. Then we can work together to get #3.

Will




At 04:03 PM 12/17/00 -0500, you wrote:
Hello,
I have checked in a number of files that are part of an image I/O framework we are developing here at UNC. For anyone that is interested in I/O matters and this candidate framework, I suggest as a starting point the following article on Pluggable Object Factories at C++ Report:
 
http://www.creport.com/html/from_pages/view_recent_articles_c.cfm?ArticleID=1520
 
My own article, ImageIO.html (in the documents directory of the repository), then describes how to leverage this concept for file I/O.
 
Please note that before checking in these new files, I performed a CVS checkout in a new directory at 1:45 PM on 12/17. I was unable to build the existing code successfully on any platform other than VisualC++ (Linux, SunOS, SGI all fail), and so I am unable to verify that my new files are cross-platform compatible with respect to the latest state of the repository. Therefore, I have refrained from making these new files part of the build process for the time being, and have not modified any of the CMakeLists. So I don't anticipate my changes to cause any problems, but please let me know as soon as possible if they do in fact break something; I'll be checking e-mail frequently while on vacation for the next three weeks.
 
Below is a list of all the new files I added, along w/ very brief descriptions of the classes:
 
Under Code/Common:
itkMaker.h
itkMaker.txx - pluggable object factory base class. templated over key type and object type
itkFileIOCommon.h
itkFileIOCommon.cxx
itkFileIO.h
itkFileIO.cxx - image i/o base class. does little more than define an interface and an abstract object factory
itkFilterFileIOToImage.h
itkFilterFileIOToImage.txx - base class for transferring image data from a FileIO to an Image
itkIntTypes.h - defines the integer types for cross-platform compatibility. probably not needed

 
Under Code/Interfaces/MetaImage:
itkFileIOMetaImageCommon.h
itkFileIOMetaImageCommon.cxx

itkFileIOMetaImage.h
itkFileIOMetaImage.cxx - one concrete implementation of a FileIO and factory to illustrate the framework.
Under Testing/Code/Common:
itkFileIOTest.cxx - uses FileIOMetaImage, Image<>, and FilterFileIOToImage to illustrate the API presented to developer

 
Under Documents:
ImageIO1.jpg
ImageIO.html - article describing the framework

 
I welcome your comments and suggestions, and hope that some of these ideas will prove to be useful in the final I/O framework.
 
Thanks,
-Parag Chandra
--=====================_153339851==_.ALT--