Re: [vmtk-users] dealing with large data
Brought to you by:
davidsteinman,
lucantiga
From: Luca A. <an...@ma...> - 2007-02-06 05:05:36
|
Hi Joong-Ho, let's say there are several levels at which the problem of large files can be tackled. One thing you must be aware of is that level sets take a lot of memory, mainly for storing the original image, the gradient magnitude image, and the gradient image (for the advection term). Just these take up 4x the memory of the original image. There's not a whole lot you can do about this. However, you managed to segment the first chunk of data, which is promising. The second thing is that colliding fronts takes even more memory during the initialization, so expect your memory usage to go up. For your information, fast marching takes than colliding fronts, thresholding less than fast marching and isosurface less than thresholding. Another suggestion is on the system: free up space on the hard drive for hosting your virtual memory file. It's better if your PC starts swapping than just killing the application because memory is full. Now, on to the solutions: It is definetly possible to segment in chunks and then merge after the fact. Or you could segment on lower resolution images and then optimize non interactively on full resolution. Let's explore the various possibilities. 1. Segmenting one vessel at a time on the full image and merging the results: Use vmtklevelsetsegmentation as usual. Then merge the resulting levelsets files with vmtkimagecompose -ifile foo_ls1.vti -i2file foo_ls2.vti -operation min -ofile foo_ls12.vti Eventually, you can do it in sequence vmtkimagecompose -ifile foo_ls1.vti -i2file foo_ls2.vti -operation min --pipe vmtkimagecompose -i2file foo_ls3.vti -ofile foo_ls123.vti and so on. 2. Generating small VOIs, segmenting all vessels in each VOI and merging the results: Use vmtklevelsetsegmentation as usual on each small VOI. I suggest to generate VOIs that have at least a small overlap, so the segmented vessels will merge seamlessly. Once you have your segmentations on the small VOIs, you have to sample them on a larger canvas and then merge them as in the previous point. vmtkimagereslice -ifile foo_ls1.vti -rfile originalimage.vti - background -4.0 -ofile foo_ls1re.vti Here original image is the full image: it's just used to provide the origin/spacing/extent information for the resampling, i.e. the size and position of the canvas. Do this for every image, then merge all re images as in 1. 3. Segmenting the full image at low resolution and optimizing the result on high resolution non-interactively: this is the solution I suggest the most. Probably your acquired image has a resolution that goes well beyond what you actually need to depict the aorta and the iliacs. Of course the more resolution the marrier, but you could use a lower resolution image to perform your segmentation quickly and interactively, without bringing down the system in the process. Then resample the ls file to full resolution and use it as initiallevelsets for the final non-interactive optimization of your segmentation on the full resolution image. Let's start by resampling the image: vmtkimagereslice -ifile originalimage.vti -spacing 1.0 1.0 1.0 -ofile resampledimage.vti Then run vmtklevelsetsegmentation on resampledimage.vti (here I set isotropic resolution of 1.0mm, but you can of course choose otherwise). Once you're done and you've got your foo_ls.vti levelsets file, resample it at full resolution vmtkimagereslice -ifile foo_ls.vti -rfile originalimage.vti -ofile foo_lsre.vti and, last, run vmtklevelsetsegmentation vmtklevelsetsegmentation -ifile originalimage.vti - initiallevelsetsfile foo_lsre.vti -iterations 300 -advectionweight 1.0 -ofile foo_ls.vti In this way, no rendering window will come up. Level sets will evolve with the iterations and weights you specify at command line, and will be initialized with foo_lsre.vti I hope you can find the right solution for your needs among the three of these. Best Luca -- Luca Antiga, PhD Biomedical Technologies Laboratory, Bioengineering Department, Mario Negri Institute email: an...@ma... web: http://villacamozzi.marionegri.it/~luca mail: Villa Camozzi, 24020, Ranica (BG), Italy phone: +39 035 4535-381 On Feb 3, 2007, at 2:10 AM, Joong-Ho Won wrote: > Hi Luca, > > Thanks for the notice. I will use 3.0.1 next time I compile VMTK (hope > it's not too soon :) ). > > Now I'm working on real datasets. They are scans of abdominal aorta > and > iliac arteries. Each dataset is made of 600-1000+ dicom files. > > As you may have guessed, there is a memory problem. vmtkimagereader > couldn't read more than 495 slices. So I dropped some chunks and was > able to load them. VOI selector worked well, and the next task is > level > set segmentation. > > It seem to be working, but after segmenting the first branch, when I > tried initial segmentation, VMTK reported out of memory and nothing > happened. That same thing happened even though I save the first > segmentation and continued segmentation using -levelsetsfile option. > > My desktop has 2GB of memory, and this is the physical limit of the > hardware. Maybe the only solution is to split them into several parts > and merge the results. > > So I wonder if it is possible: > > 1. merge segmentation files off-line, that is, outside of > vmtklevelsetsegmentation. > > 2. merge centerlines > > It seems 2 should be enough for my purpose, but when I tested with > splitting, the origins didn't match. It appears that > vmtkimagereader has > -origin option, but they are not for dicom format. > > Could you figure out a solution? Thanks. > > Regards, > > Joong-Ho. > > > > Luca Antiga wrote: >> Hi Joong-Ho, >> after checking with Luis Ibanez, I found out that the problem has >> been >> fixed in the current ITK stable version (3.0.1) >> I compile it and I confirm that the problem is gone. >> Ciao >> >> Luca >> > > ---------------------------------------------------------------------- > --- > Using Tomcat but need to do more? Need to support web services, > security? > Get stuff done quickly with pre-integrated technology to make your > job easier. > Download IBM WebSphere Application Server v.1.0.1 based on Apache > Geronimo > http://sel.as-us.falkag.net/sel? > cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > vmtk-users mailing list > vmt...@li... > https://lists.sourceforge.net/lists/listinfo/vmtk-users |