[Insight-users] ImageFileWriter crashes in creatImageIO in Debug mode

Emma Ryan eryanvtk at yahoo.com
Fri Jul 16 23:58:42 EDT 2010


Hello All,

   I have written a simple program to write out a JPG image of input data. all 
is well and internediate results of my program are correct. However, when I try 
to write the jpg, then program crashes. Here is teh code snippet.  Please 
suggest some tips to identify/correct the problem. The program crashes when 
Update() is called and program counter is in CreateImageIO function.  The input 
image, 'mask' seems to be set correctly in the writer. Yet, the writer crashes. 
All this works fine in Release mode. I am using VS 2005.


void write_to_jpg(std::string filename, itk::Image<unsigned char, 2>::Pointer 
mask) 

{
    typedef itk::Image<unsigned char, 2> InputImageType, UCharImageType; 
    itk::ImageFileWriter<UCharImageType>::Pointer p_writer = 
itk::ImageFileWriter<UCharImageType>::New();
    p_writer->SetFileName(filename);
    p_writer->SetInput(mask);

    itk::Image<unsigned char, 2>::PixelContainer * p_cont = 
mask->GetPixelContainer();
    unsigned char const * p_image_data = p_cont->GetImportPointer();
    for(int ii = 0; ii < 10; ++ii)
        for(int jj = 0; jj < 10; ++jj)
            std::cout << ii << ", " << jj << ", " << int(p_image_data[ii*10+jj]) 
<< std::endl;

    try
    {
        p_writer->Update();
    }
    catch(itk::ExceptionObject & err)
    {
        std::cout<<  "Writer Update failed:"<< std::endl;
    }
}



Program crashes in :

std::list<LightObject::Pointer> allobjects =
    ObjectFactoryBase::CreateAllInstance("itkImageIOBase");
  for(std::list<LightObject::Pointer>::iterator i = allobjects.begin();


Thank you,
Emma





________________________________
From: "insight-users-request at itk.org" <insight-users-request at itk.org>
To: insight-users at itk.org
Sent: Fri, July 16, 2010 9:00:33 AM
Subject: Insight-users Digest, Vol 75, Issue 29

Send Insight-users mailing list submissions to
    insight-users at itk.org

To subscribe or unsubscribe via the World Wide Web, visit
    http://www.itk.org/mailman/listinfo/insight-users
or, via email, send a message with subject or body 'help' to
    insight-users-request at itk.org

You can reach the person managing the list at
    insight-users-owner at itk.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Insight-users digest..."


Today's Topics:

   1. Re: Segmentation validation Curves, Spheres (Juan Cardelino)
   2. Re: building contour trees (Reda, Fitsum A)


----------------------------------------------------------------------

Message: 1
Date: Fri, 16 Jul 2010 11:13:13 -0300
From: Juan Cardelino <juan.cardelino at gmail.com>
Subject: Re: [Insight-users] Segmentation validation Curves, Spheres
To: elhadj meljane <elhadj.meljane at gmail.com>
Cc: ITK Users <insight-users at itk.org>
Message-ID:
    <AANLkTilymdEDPOg4y8Fz4CPPyL9O8AXzzymjgrfPLDWy at mail.gmail.com>
Content-Type: text/plain; charset=UTF-8

Hi elhadj,
              In the 2D case I know some works that, compare
segmentations, by either compare boundary maps or partitions. If your
ultimate goal is segmentation, I'm not sure if it is a good idea to
compare curves, I'd rather compare segmentations. Regarding boundary
comparison you can check the work of D. Martin at Berkeley, and a
benchmark system called Berkeley Segmentation Dataset or something
like that. Regarding the region based approach, you should check the
work of J. Cardoso, search for "Quantitative evaluation".
If you really want to compare curves, there's I know some work
comparing curves represented as distance maps, which compare them
modulo a rigid transformation.
I hope this helps.
Best regards,
                  Juan

On Wed, Jul 14, 2010 at 2:20 PM, elhadj meljane
<elhadj.meljane at gmail.com> wrote:
> Hi all,
> I'm looking for a tool to validate my segmentation results in 2D and 3D:
> ??- 2D: I have manual and automatic segmented curves
> ??- ?3D: I have a manual segmentation of a sphere-like structure and a
> simulated sphere like structure
>
> I would like to know:
>
> -? Do I have to choose manually a set of points on the manual and automatic
> ?? segmentation to compute a distance between the two sets (for example
> ?? housdorff distance)?
> - there is an itk tool (or a simplest way) that I can use it to validate the
> segmentation?
> ?? Thank you
> ?? Sincerely,
> H.
> _____________________________________
> 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://www.kitware.com/products/protraining.html
>
> 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://www.itk.org/mailman/listinfo/insight-users
>
>


------------------------------

Message: 2
Date: Fri, 16 Jul 2010 11:10:51 -0400
From: "Reda, Fitsum A" <fitecx at gmail.com>
Subject: Re: [Insight-users] building contour trees
To: Liam Kurmos <quantum.leaf at googlemail.com>,    insight-users
    <insight-users at itk.org>
Message-ID:
    <AANLkTin_6jaaUDcGcPs3Wgwhdvu5rQz8ogUZG8lViTUw at mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1

On 7/13/10, Liam Kurmos <quantum.leaf at googlemail.com> wrote:
> Hi All,
>
> I'm wondering if anyone has experience of building Contour Trees (such
> as per http://citeseer.ist.psu.edu/carr99computing.html ) from volume
> data? and if so whether there are any open source libraries for tree
> construction? I have looked at libtourtre
> http://graphics.cs.ucdavis.edu/~sdillard/libtourtre/doc/html/ but so
> far not had much success with getting it to work.
>
> If anyone has any information of how to do it, please let me know.
>
> Liam
> _____________________________________
> 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://www.kitware.com/products/protraining.html
>
> 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://www.itk.org/mailman/listinfo/insight-users
>

-- 
Sent from my mobile device


------------------------------

_______________________________________________
Insight-users mailing list
Insight-users at itk.org
http://www.itk.org/mailman/listinfo/insight-users


End of Insight-users Digest, Vol 75, Issue 29
*********************************************



      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20100716/d21053e3/attachment.htm>


More information about the Insight-users mailing list