[Insight-users] Application walk through
Neil Killeen
Neil.Killeen@atnf.csiro.au
Thu, 9 Jan 2003 14:10:30 +1100 (EST)
G'day Luis
thanks for your comments. Some invevitable followup below... :-)
> >
> > 1) I have created the Image typedef
> >
> > typedef itk::Image<float, 2> ImageType;
> >
> > I had to specify the dimensionality of the image (2) at this point.
> >
> > Is this really necessary ? In my opinion, it is very inflexible to have to
> > specify it here. A generic display tool for example should be able
> > to read and display an image of arbitrary dimensionality.
> >
>
>
>
>
> Totally agree with you,
> A general display tool should deal with arbitrary dimensionality.
> However, Visualization is out of the scope of ITK.
>
> The objective of the Insight toolkit is to perform Medical
> Image Registration and Segmentation. Defining the dimension
> as a template parameter results in code that runs faster.
>
> For visualization purposes you may want to use VTK.
>
What we are building is a medical analysis platform which will
probably use itk/vtk/fltk as its main toolkit components. My idea was to
use ITK to do all file handling and analysis, passing the image
along to VTK for display. Thus, even if the user *only* wanted
to display an image, it would still go via ITK for the file
handling (so that we have just one interface layer) and then
pass it to VTK.
Because it's a template paramater, I can't even have
the user specify the dimensionaltity in the UI or
pre-fish it out of the file. It has to be hard wired into the
code, which I find bad.
Do you know of a way to work around this in ITK ? I desperately
want avoid re-writing file-handling s/w !!! Perhaps I should
use VTK file handling (I assume there is some, but don't know
about it yet) and then filter the other way to ITK and then back again ?
> > The class documentation gives no clue as to what file format types are supported.
> >
>
>
> That's exactly how it should be
> The Image File Reader is intended to be a transparent
> interface for IO totally independent of file format.
> The list of file formats supported is defined by the
> set of ImageIO objects in the directory
>
> Insight/Code/IO
>
>
I thought you would probably say that... Could the docs.
of ImageFIleReader point you at the appropriate place (not
an ideal solution IMO either) ?
> >
> > 3) The DiscreteGaussianImageFilter class does separable Gaussian convolution.
> > It's interface should be simple and clear. However, virtally every method
> > doc. says 'Standard Get/Set' macros for filter parameters.
> >
>
> Please refer to the software guide. This document is under:
>
> InsightDocuments/Web/HTML/SoftwareGuide.pdf
>
> The chapter on Smoothing describes the gaussian filters in detail
>
>
1) well maybe it does, but surely the interfaces for the classes have to
be self describing and not depend upon external documents to
which the classes do not point and which many people don't
know exist.
Should you not define the interface in the appropriate base class,
and then if any of the methods are overwritten, each specific
class describes its interface ?
2) I am getting a bit confused about the documentation structure !
In directory
Insight/InsightDocuments
that I checked out with cvs
there is
Developer Marketing README.html Validation
CourseWare Latex Papers SoftwareGuide Web
The README.html refers to
./User
./Developer
./Web
but I don't have a User directory in my tree. What is the directory
./SoftwareGuide !
Having looked at the Web/HTML/SoftwareGuide.pdf
document you referred to (which incidentally does *not*
appear on the ITK 'Documentation' web page) seems to
be a developers guide of some form. I have printed out
./Developer/DevelopersGuide/DevelopersGuide/DevelopersGuide.pdf (sep 29 2001)
./Developer/DevelopersGuide/AlgorithmsGuide/AlgorithmsGuide.pdf (aug 06 2001)
./Developer/DevelopersGuide/UsersGuide/UsersGuide.pdf (dec 19 2001)
./Developer/General/Style.pdf (June 2001)
./CourseWare/Training/Tutorial.pdf (Oct 2002)
./Web/HTML/SoftwareGuide.pdf (Dec 2002)
as well as a variety of ppt files in the Training section.
Wow you folks have written a lot of stuff !
These documents are all in various forms of completion. There is
quite a lot of duplication of introductory material.
But SoftwareGuide.pdf, I think is a different DevelopersGuide
document, yet it does not live in the Developers tree.
Are these the correct and fundamental documents to read ? Are some
now deprecated, in favour of others ? I ask this especially because some
of the older documents are incomplete.
> I hope you will not look too close to some of the comments
> we write on CVS :-)
>
>
not yet ! I hope I won't see 'fix bug' which renders the
usefulness of CVS logs close to zero...
>
> >
> > Also the heavy typedef-ing and templating makes it very hard to figure
> > out just what the arguments in the interface are. I seem to spend a lot
> > of time going back to the Alphabetical class list becaus the DOxygen
> > docs. don't hyperlink me anywhere useful a lot of the time (because of
> > typedefs I think).
> >
>
>
> Welcome to Generic Programming !
>
> With enough coffee you will get use to it and probably
> will end up liking the way the code looks.
>
> Actually I have to confess that now I find difficult
> to read code that doesn't have typedefs nor templates.
>
oh dear, you *are* in a bad way. It's mainly the breakdown
of the hyper-linking I find irksome; i'm pretty used to
heavy templating. So you find some
function and its output is some dreadful typedef expression,
but there is no link to take you to that typedef so you
can find out what the reality is. I can't drink
more coffee or I will look like a coffee bean !
>
>
> As we speak, we are working hard in getting the SoftwareGuide ready.
> The document will be in the order of 200 pages, on 48 hours from now.
> We expect it to continue growing upto about 400. This document
> describes the main features of the toolkit.
>
>
perhaps this answers my earlier question, the 'SoftwareGuide.pdf'
will be the one true developers guide and the others removed ?
By the way, do you have a technical editor for the project ?
A lot of the manuals have clearly been written by non-native English
speakers, and so much of the grammar and style is either wrong
or interestingly idiosyncratic (sometimes I struggle with the intended
meaning) ! Although this is a criticism, you
have done pretty heroic things in a short space of time regarding the
large amounts of useful documentation material. An editor would help
you (and us) get the most out of this considerable effort.
>
> >
> > I am assuming that what happens is that the data is read into an Image
> > class object (by ImageFileReader) which exists purely in memory (perhaps
> > you can get away with this because Medical imaging images are not very
> > big). This object is updated by each filter and responsibility for it
> > is transferred somehow to each successive filter. Does it get deleted
> > at the end when the last filter is destroyed ? Perhaps you could clarify
> > this for me ?
> >
>
>
> Image are not actually passed from one filter to another.
>
> in
>
> A ---> B ---- > C
>
> the output image of filter A stays with A.
> B "read" this image and use the data to compute
> the values it puts in its own output image.
> B's output image is an entity completly independent
> of A's output image. Then C reads B's output image
> and use the data to compute the values of C's
> outtput image.
>
ok. so you get quite a lot of images stored in memory this way
(they are in memory, right ?).
i was envisaging one shared image in the pipeline somehow.
i suppose since medical images are generally small (or at least,
lagging behind the available resource in a state of the art
computer) that this has not been an issue ? Also you can destroy filters
along the way to free up resources if need be I guess.
>
>
> Could you please post the error message
> produced by the compiler ?
>
> normaly you should invoke "Delete()" on VTK object.
>
>
ah ok. i was doing
delete pointer
not
pointer->Delete()
which works fine. This should be included in the
example from which I was working (GettingStarted-II.ppt)
where no deletion was done.
cheers
Neil