<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style>
<!--
.hmmessage p
{margin:0px;
padding:0px}
body.hmmessage
{font-size:12pt;
font-family:Calibri}
-->
</style><style id="owaParaStyle" type="text/css"></style>
</head>
<body ocsi="0" fpstyle="1" class="hmmessage">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">Hi Michael,<br>
<br>
It may not be strictly approved of, because it breaks the object model of ITK, but this is what I do for 8-bit 3D images:<br>
<br>
typedef itk::Image<unsigned char,3> ImageType;<br>
ImageType::Pointer im;<br>
unsigned char *p;<br>
long long width, height, depth, xysize;<br>
<br>
#define V(a,b,c) p[(c)*xysize+(b)*width+(a)]<br>
<br>
...<br>
<br>
im = reader->GetOutput();<br>
width = im->GetLargestPossibleRegion().GetSize()[0];<br>
height = im->GetLargestPossibleRegion().GetSize()[1];<br>
depth = im->GetLargestPossibleRegion().GetSize()[2];<br>
xysize = width*height;<br>
printf("Image dimensions: width, height, depth: %d %d %d\n",width,height,depth);<br>
p = (unsigned char *)(im->GetBufferPointer());<br>
<br>
Then I access the voxel at (x,y,z) by val = V(x,y,z)<br>
<br>
Cheers<br>
Gib<br>
<div style="font-family: Times New Roman; color: #000000; font-size: 16px">
<hr tabindex="-1">
<div style="direction: ltr;" id="divRpF843247"><font color="#000000" face="Tahoma" size="2"><b>From:</b> Community [community-bounces@itk.org] on behalf of Michael Yonghui Fan [fhjfyh@hotmail.com]<br>
<b>Sent:</b> Monday, 4 May 2015 5:00 p.m.<br>
<b>To:</b> community@itk.org<br>
<b>Subject:</b> Re: [ITK] new starter<br>
</font><br>
</div>
<div></div>
<div>
<div dir="ltr">correction. how to store the pixels in a 2-D array?<br>
<br>
<div>
<hr id="stopSpelling">
From: fhjfyh@hotmail.com<br>
To: community@itk.org<br>
Date: Mon, 4 May 2015 11:36:35 +0800<br>
Subject: [ITK] new starter<br>
<br>
<style>
<!--
.ExternalClass .ecxhmmessage p
{padding:0px}
.ExternalClass body.ecxhmmessage
{font-size:12pt;
font-family:Calibri}
-->
BODY {direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;}P {margin-top:0;margin-bottom:0;}BODY {scrollbar-base-color:undefined;scrollbar-highlight-color:undefined;scrollbar-darkshadow-color:undefined;scrollbar-track-color:undefined;scrollbar-arrow-color:undefined}</style>
<div dir="ltr">Hi all,
<div><br>
</div>
<div>I'm new in using GDCM, i cannot figure it out what should I do after reading image. What I want to do is to read in a dicom image, do the low-pass filter and then write the result image. it is quite basic but i just dont know how to access to the pixel
value and also the buffer. Can anyone give me some tips or examples? Thanks a lot~</div>
<div><br>
</div>
<div>M</div>
</div>
<br>
_______________________________________________ Community mailing list Community@itk.org http://public.kitware.com/mailman/listinfo/community</div>
</div>
</div>
</div>
</div>
</body>
</html>