Wei,It appears that this crash stems from the difference in spacing for the different images. When I resample them to all have consistent spacing, then ShapeWorksRun runs to completion.I noticed some other issues with your data. It appears that with at least some of the data, the two sides are not connected. ShapeWorks won't be able to model datasets where there are different numbers of objects for each patient. You may be better off with a joint model of the left and right as separate objects. Josh may have more ideas.AlanOn Thu, Jul 3, 2014 at 11:59 AM, Alan Morris <akenmorris@gmail.com> wrote:
AlanWei,Yes, the order does matter. And yes, I would put it after the auto_crop tool.
I will have to take a look at the data.On Thu, Jul 3, 2014 at 11:46 AM, Wei Liu <weiliu620@gmail.com> wrote:Alan,I didn't find the auto_pad option in current version of the document, though the xml file has the parameter. I suppose I just need to add "auto_pad" at the end of the ShapeWorkGroom preprocess1.xml command, after the auto_crop option? Does the order of the steps in preprocess1 matter?OK, I re-run the preprocess with auto_pad, and ShapeWorksRun, but still have the segfault. The output of "Groom" now has information about the padding, so I assume the auto_pad worked as expected.Thanks,WeiOn Thu, Jul 3, 2014 at 10:52 AM, Alan Morris <akenmorris@gmail.com> wrote:
Wei,I will try out your data when I get a chance. In the mean time, did you use "auto_pad" with ShapeWorksGroom? If not, I would recommend using it with a <pad>10</pad> value in your groom parameter file. I've found that without this, the computation can sometimes runs outside the bounding box of the image (which is what it looks like is happening here).
AlanOn Thu, Jul 3, 2014 at 10:41 AM, Wei Liu <weiliu620@gmail.com> wrote:
Hi Alan,Thanks for the reply. I rebuilt with type "Release with Debug info", and run on both 5 and 3 shapes.For 3 and even 4 shapes, I don't get any segfault. However, if I remove the first shape in correspondence.xml and use the remaining 4, I got "basic_string::_S_construct null not valid" error at the very beginning. If I removed the second or the last files, the remaining 4 shapes will run without errors. I think that might be a different issue. I previous preprocess step, I used 5 shapes when running "groom". Can this be the reason?If I use 5 shapes with the newly built executable with debug info, I got the following trace when I run it in gdb (attached at the end). I've check the 5 distance transform volumes that I generated in previous "groom" step, and the files look good, i.e. not corrupted. The files at at ftp://ftp.sci.utah.edu/upload/shapeworks/. Naming convention: PE105 is the original binary label map, PE105DT is the output of preprocess1, and PE105B is the output of preprocess2.Thanks again,Wei============== gdb trace for 5 shapes =======Particle count: 256Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Writing lung.0.wpts with 256pointsWriting lung.1.wpts with 256pointsWriting lung.2.wpts with 256pointsWriting lung.3.wpts with 256pointsWriting lung.4.wpts with 256pointsWriting lung.0.wpts with 256pointsWriting lung.1.wpts with 256pointsWriting lung.2.wpts with 256pointsWriting lung.3.wpts with 256pointsWriting lung.4.wpts with 256points------------------------------*** AddAdaptivity Step------------------------------------------------------------*** Optimize Step------------------------------Optimizing correspondences.Performing global stepBeforeIteration counter = 00: -2.39275e-121: 1507.722: 6264.253: 9221.544: 12432.4ENERGY = 6.92568 MinimumVariance = 10..........Performing global stepBeforeIteration counter = 00: -7.37188e-131: 1751.712: 7403.113: 103334: 13489.7ENERGY = 7.02755 MinimumVariance = 7.94328..........Writing lung.0.wpts with 256pointsWriting lung.1.wpts with 256pointsWriting lung.2.wpts with 256pointsWriting lung.3.wpts with 256pointsWriting lung.4.wpts with 256pointsPerforming global stepBeforeIteration counter = 00: 4.18954e-121: 2095.342: 8703.643: 11476.44: 15024.5ENERGY = 7.13783 MinimumVariance = 6.30957..........Performing global stepBeforeIteration counter = 00: 2.53131e-131: 2526.82: 10131.43: 12508.74: 16966.7ENERGY = 7.24689 MinimumVariance = 5.01187..........Writing lung.0.wpts with 256pointsWriting lung.1.wpts with 256pointsWriting lung.2.wpts with 256pointsWriting lung.3.wpts with 256pointsWriting lung.4.wpts with 256pointsPerforming global stepBeforeIteration counter = 00: -3.3924e-121: 3021.262: 11694.53: 13581.54: 19224.8ENERGY = 7.35258 MinimumVariance = 3.98107..........Performing global stepBeforeIteration counter = 00: -3.55715e-121: 3568.422: 13370.23: 14793.54: 21730.6ENERGY = 7.45411 MinimumVariance = 3.16228..........Writing lung.0.wpts with 256pointsWriting lung.1.wpts with 256pointsWriting lung.2.wpts with 256pointsWriting lung.3.wpts with 256pointsWriting lung.4.wpts with 256pointsPerforming global stepBeforeIteration counter = 00: 8.60201e-121: 4187.572: 15055.23: 16223.14: 24401.8ENERGY = 7.5514 MinimumVariance = 2.51189..........Performing global stepBeforeIteration counter = 00: -4.90941e-131: 4883.322: 16621.53: 180294: 27197.2ENERGY = 7.64467 MinimumVariance = 1.99526.Program received signal SIGSEGV, Segmentation fault.itk::LinearInterpolateImageFunction<itk::Image<float, 3u>, double>::EvaluateAtContinuousIndex (this=0xbe4f40, index=...)at /scratch/packages/InsightToolkit-3.20.1/Code/Common/itkLinearInterpolateImageFunction.txx:150150 value += static_cast<RealType>( this->GetInputImage()->GetPixel( neighIndex ) ) * overlap;(gdb)=========== end of gdb trace for 5 shapes ================On Wed, Jul 2, 2014 at 3:51 PM, Alan Morris <akenmorris@gmail.com> wrote:
Wei,Could you build ShapeWorksRun with debugging symbols and send us the stacktrace? Alternatively, if you could point us to the data, that would be great.
Can you reproduce it with a smaller sample of data (e.g. 3 shapes).
Thanks,
AlanOn Tue, Jul 1, 2014 at 4:01 PM, Wei Liu <weiliu620@gmail.com> wrote:
Dear shapeworks users,Today I got a segmentation fault when running ShapeWorksRun on my CT image of 5 volumes. From the screen log, it seems the segfault happened at the "optimization step". Below I attached the log, the xml configuration file and the files that have been generated before the segfault happens.I was monitoring the memory usage and found the allocated memory was within the limit of my physical memory.Any insights on this issue? Or any flag to turn on to print more debug information?Thanks in advance,Wei========= ShapeWorksRun log ===================weiliu@lando:/scratch/experiments/shapeworks> /scratch/packages/shapeworks.git/build/ShapeWorksRun/ShapeWorksRun lung.correspondence.xmlm_processing_mode = 3m_number_of_particles = 256m_optimization_iterations = 200m_output_points_prefix = lungm_output_transform_file = output_transform_filem_domains_per_shape = 1m_timepts_per_subject = 1m_starting_regularization = 10m_ending_regularization = 0.1m_iterations_per_split = 200m_relative_weighting = 1m_norm_penalty_weighting = 0m_initial_relative_weighting = 0.05m_initial_norm_penalty_weighting = 0m_adaptivity_strength = 0m_attributes_per_domain = 0m_checkpointing_interval = 20m_transform_file =m_prefix_transform_file =m_procrustes_interval = 0m_recompute_regularization_interval = 1m_procrustes_scaling = 1m_adaptivity_mode = 0m_keep_checkpoints = 0m_optimization_iterations_completed = 0Procrustes scaling is onMean curvature magnitude = 0.0410644Std deviation = 0.0386809Mean curvature magnitude = 0.0483452Std deviation = 0.0401311Mean curvature magnitude = 0.0528453Std deviation = 0.0415891Mean curvature magnitude = 0.0442168Std deviation = 0.0440822Mean curvature magnitude = 0.039068Std deviation = 0.0368917------------------------------*** Initialize Step------------------------------Particle count: 2Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Writing lung.0.wpts with 2pointsWriting lung.1.wpts with 2pointsWriting lung.2.wpts with 2pointsWriting lung.3.wpts with 2pointsWriting lung.4.wpts with 2pointsParticle count: 4Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Writing lung.0.wpts with 4pointsWriting lung.1.wpts with 4pointsWriting lung.2.wpts with 4pointsWriting lung.3.wpts with 4pointsWriting lung.4.wpts with 4pointsParticle count: 8Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Writing lung.0.wpts with 8pointsWriting lung.1.wpts with 8pointsWriting lung.2.wpts with 8pointsWriting lung.3.wpts with 8pointsWriting lung.4.wpts with 8pointsParticle count: 16Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Writing lung.0.wpts with 16pointsWriting lung.1.wpts with 16pointsWriting lung.2.wpts with 16pointsWriting lung.3.wpts with 16pointsWriting lung.4.wpts with 16pointsParticle count: 32Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Writing lung.0.wpts with 32pointsWriting lung.1.wpts with 32pointsWriting lung.2.wpts with 32pointsWriting lung.3.wpts with 32pointsWriting lung.4.wpts with 32pointsParticle count: 64Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Writing lung.0.wpts with 64pointsWriting lung.1.wpts with 64pointsWriting lung.2.wpts with 64pointsWriting lung.3.wpts with 64pointsWriting lung.4.wpts with 64pointsParticle count: 128Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Writing lung.0.wpts with 128pointsWriting lung.1.wpts with 128pointsWriting lung.2.wpts with 128pointsWriting lung.3.wpts with 128pointsWriting lung.4.wpts with 128pointsParticle count: 256Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Performing global step..........Writing lung.0.wpts with 256pointsWriting lung.1.wpts with 256pointsWriting lung.2.wpts with 256pointsWriting lung.3.wpts with 256pointsWriting lung.4.wpts with 256pointsWriting lung.0.wpts with 256pointsWriting lung.1.wpts with 256pointsWriting lung.2.wpts with 256pointsWriting lung.3.wpts with 256pointsWriting lung.4.wpts with 256points------------------------------*** AddAdaptivity Step------------------------------------------------------------*** Optimize Step------------------------------Optimizing correspondences.Performing global stepBeforeIteration counter = 00: -1.95399e-121: 2233.632: 6109.693: 9130.24: 13024.7ENERGY = 7.00618 MinimumVariance = 10..........Performing global stepBeforeIteration counter = 00: 9.722e-121: 2632.272: 7232.23: 10060.24: 14207.3ENERGY = 7.10904 MinimumVariance = 7.94328..........Writing lung.0.wpts with 256pointsWriting lung.1.wpts with 256pointsWriting lung.2.wpts with 256pointsWriting lung.3.wpts with 256pointsWriting lung.4.wpts with 256pointsPerforming global stepBeforeIteration counter = 00: 1.0556e-111: 3094.512: 8472.643: 11077.34: 15777.5ENERGY = 7.21294 MinimumVariance = 6.30957..........Performing global stepBeforeIteration counter = 00: 2.98161e-121: 3625.512: 9820.693: 12145.64: 17588.4ENERGY = 7.31406 MinimumVariance = 5.01187..........Writing lung.0.wpts with 256pointsWriting lung.1.wpts with 256pointsWriting lung.2.wpts with 256pointsWriting lung.3.wpts with 256pointsWriting lung.4.wpts with 256pointsPerforming global stepBeforeIteration counter = 00: 1.29785e-111: 4217.282: 11188.93: 13313.24: 19565.2ENERGY = 7.40989 MinimumVariance = 3.98107..........Performing global stepBeforeIteration counter = 00: 1.87255e-111: 4865.532: 12485.83: 14779.84: 21615.6ENERGY = 7.50115 MinimumVariance = 3.16228.........Segmentation fault============ end of ShapeWorksRun log ========================= files generated ==================-rw-r--r-- 1 weiliu users 6825 Jul 1 14:45 lung.0.wpts-rw-r--r-- 1 weiliu users 6825 Jul 1 14:45 lung.0.lpts-rw-r--r-- 1 weiliu users 6790 Jul 1 14:45 lung.1.lpts-rw-r--r-- 1 weiliu users 6790 Jul 1 14:45 lung.1.wpts-rw-r--r-- 1 weiliu users 6820 Jul 1 14:45 lung.2.wpts-rw-r--r-- 1 weiliu users 6820 Jul 1 14:45 lung.2.lpts-rw-r--r-- 1 weiliu users 6807 Jul 1 14:45 lung.3.wpts-rw-r--r-- 1 weiliu users 6807 Jul 1 14:45 lung.3.lpts-rw-r--r-- 1 weiliu users 644 Jul 1 14:45 output_transform_file-rw-r--r-- 1 weiliu users 6812 Jul 1 14:45 lung.4.wpts-rw-r--r-- 1 weiliu users 6812 Jul 1 14:45 lung.4.lpts-rw-r--r-- 1 weiliu users 6817 Jul 1 14:45 lung.d0.mean-rw-r--r-- 1 weiliu users 6843 Jul 1 14:45 lung.d0.-3.0.mode-rw-r--r-- 1 weiliu users 6829 Jul 1 14:45 lung.d0.-2.0.mode-rw-r--r-- 1 weiliu users 6818 Jul 1 14:45 lung.d0.-1.0.mode-rw-r--r-- 1 weiliu users 6809 Jul 1 14:45 lung.d0.2.0.mode-rw-r--r-- 1 weiliu users 6814 Jul 1 14:45 lung.d0.1.0.mode-rw-r--r-- 1 weiliu users 6791 Jul 1 14:45 lung.d0.3.0.mode-rw-r--r-- 1 weiliu users 6793 Jul 1 14:45 lung.d0.-3.1.mode-rw-r--r-- 1 weiliu users 6790 Jul 1 14:45 lung.d0.-2.1.mode-rw-r--r-- 1 weiliu users 6805 Jul 1 14:45 lung.d0.-1.1.mode-rw-r--r-- 1 weiliu users 6823 Jul 1 14:45 lung.d0.2.1.mode-rw-r--r-- 1 weiliu users 6804 Jul 1 14:45 lung.d0.1.1.mode-rw-r--r-- 1 weiliu users 6796 Jul 1 14:45 lung.d0.3.1.mode-rw-r--r-- 1 weiliu users 6790 Jul 1 14:45 lung.d0.-3.2.mode-rw-r--r-- 1 weiliu users 6775 Jul 1 14:45 lung.d0.-2.2.mode-rw-r--r-- 1 weiliu users 6795 Jul 1 14:45 lung.d0.-1.2.mode-rw-r--r-- 1 weiliu users 6818 Jul 1 14:45 lung.d0.1.2.mode-rw-r--r-- 1 weiliu users 6808 Jul 1 14:45 lung.d0.3.2.mode-rw-r--r-- 1 weiliu users 6829 Jul 1 14:45 lung.d0.2.2.mode-rw-r--r-- 1 weiliu users 6827 Jul 1 14:45 lung.d0.-3.3.mode-rw-r--r-- 1 weiliu users 6793 Jul 1 14:45 lung.d0.-2.3.mode-rw-r--r-- 1 weiliu users 6801 Jul 1 14:45 lung.d0.-1.3.mode-rw-r--r-- 1 weiliu users 6798 Jul 1 14:45 lung.d0.1.3.mode-rw-r--r-- 1 weiliu users 6815 Jul 1 14:45 lung.d0.3.3.mode-rw-r--r-- 1 weiliu users 6806 Jul 1 14:45 lung.d0.2.3.mode-rw-r--r-- 1 weiliu users 6817 Jul 1 14:45 lung.d0.-3.4.mode-rw-r--r-- 1 weiliu users 6817 Jul 1 14:45 lung.d0.-2.4.mode-rw-r--r-- 1 weiliu users 6816 Jul 1 14:45 lung.d0.1.4.mode-rw-r--r-- 1 weiliu users 6817 Jul 1 14:45 lung.d0.-1.4.mode-rw-r--r-- 1 weiliu users 6817 Jul 1 14:45 lung.d0.2.4.mode-rw-r--r-- 1 weiliu users 6816 Jul 1 14:45 lung.d0.3.4.mode=============== configuration .xml file =====================<?xml version="1.0" ?><!-- List of files containing the set of shape surfaces. --><inputs>PE105B.nii.gzPE900B.nii.gzPE908B.nii.gzPE916B.nii.gzPE919B.nii.gz</inputs><!--OPTIONALLY we could specify a set of point files to initialize the optimization like this:<point_files>torusDT.00.lptstorusDT.01.lpts:.torusDT.19.lpts</point_files>--><!-- If point files are not specified, then the application will initialize particlesby splitting until each shape has this total number of particles. --><number_of_particles> 256 </number_of_particles><!-- Iterations between splitting during initialization phase. --><iterations_per_split> 200 </iterations_per_split><!-- Starting regularization for the entropy-based correspondence optimization. --><starting_regularization> 10.0 </starting_regularization><!-- Final regularization for the entropy-based correspondence. --><ending_regularization> 0.1 </ending_regularization><!-- Number of iterations for the entropy-based correspondence. --><optimization_iterations> 200 </optimization_iterations><!-- Number of iterations between checkpoints (iterations at which results are saved) --><checkpointing_interval> 20 </checkpointing_interval><!-- Prefix for the output files. --><output_points_prefix> lung </output_points_prefix>
Archive powered by MHonArc 2.6.18.