<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman,new york,times,serif;font-size:12pt"><div>Hi all,<br><br>I am trying to create a one voxel image (that will grow depending on the number of steps in the algorithm) using to following code:<br> const unsigned int Dimension = 3;<br> typedef itk::Matrix<double, 4, 4> MatrixType;<br> typedef itk::Image<MatrixType, Dimension> MatrixFieldType;<br> MatrixFieldType::Pointer matrixfield = MatrixFieldType::New();<br> MatrixFieldType::IndexType index;<br> index.Fill( 0 );<br> MatrixFieldType::SizeType size;<br> size.Fill( 1 );<br> MatrixFieldType::RegionType region( index, size );<br> matrixfield->SetRegions( region );<br>
matrixfield->Allocate();<br> MatrixType matrix;<br> matrix.SetIdentity();<br> matrixfield->SetPixel( index, matrix );<br>However this code crashes.<br>When I fill size with 2's, the code seems to work.<br><br>Any ideas? Maarten<br></div>
</div><br>
</body></html>