[Insight-users] large image matrix

M.Staring at lumc.nl M.Staring at lumc.nl
Mon Oct 6 17:42:19 EDT 2008


Hi Torsten,

You want to allocate 24 GB of memory, so your computer should have at least that amount of memory. And you need to go to 64 bit systems.

You are able to allocate 2^14 images, since that amounts to 1.5 GB.

So, it is not so much a matter of "how to do this in ITK", but to upgrade your computer.

Alternatively, you may want to consider processing your images piece by piece, i.e. use streaming. You might want to take a look at the itk::StreamingImageFilter.

Regards,

Marius


-----Original Message-----
From: insight-users-bounces at itk.org on behalf of Thorsten W.
Sent: Mon 10/6/2008 10:57 PM
To: insight-users at itk.org
Subject: [Insight-users] large image matrix
 
Hello ITK-Users,

i'm new on ITK and my english skills are not the best ;)

Within the scope of a research projekt, i have to work with very large
dicom images, or that is to say 2^16 * 2^16 * 24bit.

I want to create a picture with the above-mentioned resolution with itk
and write it to disk.

But the highest resolution without allokation errors is under 
Windows ~ 2^14 * 2^14 and under Linux ~ 20000*20000...

My computer has 2 gigabyte ram. Windows XP and Ubuntu Hardy Heron are
both 32bit.

Can someone help me to create a image with the resolution 2^16 * 2^16 *
24bit?

Sincerly,
Thorsten from germany :)

#include "itkImage.h"
#include "itkImageFileWriter.h"
#include "itkGDCMImageIO.h"
#include "itkRGBPixel.h"
#include <iostream>

int main()

{

  typedef itk::RGBPixel<unsigned char> PixelType;
  typedef itk::Image< PixelType, 2 > ImageType;
  typedef itk::ImageFileWriter<ImageType> WriterType;
  typedef itk::GDCMImageIO ImageType2;

  ImageType::Pointer image = ImageType::New();
  WriterType::Pointer writer = WriterType::New();
  ImageType2::Pointer dicomio = ImageType2::New();
  ImageType::IndexType start;

  start[0] = 0;
  start[1] = 0;

  ImageType::SizeType size;

  size[0] = 20000;
  size[1] = 20000;

  ImageType::RegionType region;
  region.SetSize(size);
  region.SetIndex(start);

  image->SetRegions(region);

  try
  {
        image->Allocate();
  }

  catch (itk::ExceptionObject &excp)
  {
        std::cerr << "Exception thrown while 0" << std::endl;
        std::cerr << excp << std::endl;
  }

  ImageType::SpacingType spacing;
  spacing[0] = 1;
  spacing[1] = 1;
  image->SetSpacing(spacing);

  ImageType::PointType origin;
  origin[0] = 0;
  origin[1] = 0;
  image->SetOrigin(origin);

  writer->SetFileName("/home/thorsten/bla.dcm");
  writer->SetInput(image);
  writer->SetImageIO(dicomio);

  try
  {
        writer->Update();
  }
  catch (itk::ExceptionObject &excp)
  {
        std::cerr << "Exception thrown while 0" << std::endl;
        std::cerr << excp << std::endl;
  }
  return 0;
}

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

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


More information about the Insight-users mailing list