<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="MSHTML 6.00.2900.2668" name=GENERATOR>
<STYLE>
P.MsoNormal {
        FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman"
}
LI.MsoNormal {
        FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman"
}
DIV.MsoNormal {
        FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman"
}
A:link {
        COLOR: blue; TEXT-DECORATION: underline
}
SPAN.MsoHyperlink {
        COLOR: blue; TEXT-DECORATION: underline
}
A:visited {
        COLOR: purple; TEXT-DECORATION: underline
}
SPAN.MsoHyperlinkFollowed {
        COLOR: purple; TEXT-DECORATION: underline
}
P.MsoPlainText {
        FONT-SIZE: 10pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Courier New"
}
LI.MsoPlainText {
        FONT-SIZE: 10pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Courier New"
}
DIV.MsoPlainText {
        FONT-SIZE: 10pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Courier New"
}
DIV.Section1 {
        page: Section1
}
</STYLE>
</HEAD>
<BODY lang=EN-US vLink=purple link=blue>
<DIV id=idOWAReplyText89257 dir=ltr>
<DIV dir=ltr><FONT face=Arial color=#000000 size=2></FONT> </DIV></DIV>
<DIV dir=ltr><BR>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> Atwood, Robert C<BR><B>Sent:</B> Thu
11/08/2005 19:06<BR><B>To:</B> ITK Mailing List<BR><B>Subject:</B> Median:
different result on different machines<BR></FONT><BR></DIV>
<DIV>
<DIV id=idOWAReplyText28106 dir=ltr>Dear ITK list:</DIV>
<DIV dir=ltr> </DIV>
<DIV dir=ltr>I noticed different results on a new machine compared to the same
code on the old machine, so I carefully removed all parts of my code until I had
the minimum that exhibits the different results. It is basically </DIV>
<DIV dir=ltr> </DIV>
<DIV dir=ltr>ImageFileReader ---> MedianImageFilter ---> ImageFileWriter
</DIV>
<DIV dir=ltr> </DIV>
<DIV dir=ltr>Machine 1: Intel p4 2800 , RedHat enterprise WS-3 + online
up2date, ITK from a few weeks ago cvs</DIV>
<DIV dir=ltr> </DIV>
<DIV dir=ltr>Machine 2 Intel p4 3400 with em64t (x86_64) SUSE 9.1 + online
Y.O.U. updates , ITK from today (but first I tried with the same ITK
source as Machine 1 with the same effect.</DIV>
<DIV dir=ltr> </DIV>
<DIV dir=ltr> </DIV>
<DIV dir=ltr>On machine 1 the median result looks correct (here it is hard-coded
radius 3 jsut to try) </DIV>
<DIV dir=ltr> </DIV>
<DIV dir=ltr>On machine 2 there is speckle noise that seems to appear as a
result of the median.</DIV>
<DIV dir=ltr> </DIV>
<DIV dir=ltr>Running the test program that was compiled on machine 1, on machine
2, does not give the speckles. I got rid of my slice print output routine in
case that was causing it, and used an independant volume viewer to look at the
volume, it is definintely speckly! </DIV>
<DIV dir=ltr> </DIV>
<DIV dir=ltr>I hope this is a simple problem that someone already knows
the answer for , and can share it with me. Otherwise, I can provide any
additional details that will be useful to diagnose the problem. It would be nice
if it worked on the new machine because it is considerably faster.</DIV>
<DIV dir=ltr> </DIV>
<DIV dir=ltr>Thanks</DIV>
<DIV dir=ltr>Robert</DIV>
<DIV dir=ltr> </DIV>
<DIV dir=ltr> </DIV>
<DIV dir=ltr>(here's the code) </DIV>
<DIV dir=ltr> </DIV>
<DIV dir=ltr> </DIV>
<DIV dir=ltr>#include <stdio.h><BR>#include <string.h><BR>#include
<malloc.h></DIV>
<DIV dir=ltr>#include "itkImage.h"<BR>#include
"itkImageFileWriter.h"<BR>#include "itkImageFileReader.h"<BR>#include
"itkMedianImageFilter.h"</DIV>
<DIV dir=ltr> typedef float PixelType;</DIV>
<DIV dir=ltr> typedef itk::Image< PixelType, 3 >
ScalarImageType;</DIV>
<DIV dir=ltr> // definitions for writing the image<BR> typedef
itk::ImageFileWriter< ScalarImageType > WriterType;<BR> typedef
itk::ImageFileReader<ScalarImageType> ReaderType;<BR> //median
filter <BR> typedef
itk::MedianImageFilter<ScalarImageType,ScalarImageType> VolMedian;</DIV>
<DIV dir=ltr>/*********************************/<BR>/* beginning of MAIN
routine */<BR>/*********************************/<BR>int
main(int argc, char ** argv) {</DIV>
<DIV dir=ltr> int med_rad=3;<BR> /* ITK objects needed for
processing the volume */<BR> VolMedian::Pointer volmedian =
VolMedian::New();<BR> ReaderType::Pointer reader =
ReaderType::New();<BR> WriterType::Pointer writer =
WriterType::New();<BR> ScalarImageType::SizeType vol_rad;</DIV>
<DIV dir=ltr> if (argc != 2){<BR>
printf("Little program to test itk median
filter\n");<BR> printf("Usage: %s
input.mhd\n",argv[0]);<BR> printf("Only itk
registered data file types to avoid extra\n");<BR>
printf("import filter code.\n");<BR>
printf("Median radius fixed at %i\n",med_rad);<BR>
return(0);<BR> }</DIV>
<DIV dir=ltr> vol_rad[0] = med_rad;<BR> vol_rad[1] =
med_rad;<BR> vol_rad[2] = med_rad;</DIV>
<DIV dir=ltr> volmedian->SetRadius(vol_rad);</DIV>
<DIV dir=ltr> printf("...3d Median ... itk radius %i
..\n",med_rad);<BR>
volmedian->SetInput(reader->GetOutput());<BR> /*
add the volume writer */<BR>
writer->SetInput(volmedian->GetOutput());<BR>
writer->SetFileName( "mediantest.mhd" );<BR>
reader->SetFileName(argv[1]);<BR> try {<BR>
writer->Update();<BR> }catch( itk::ExceptionObject & exp )
{<BR> std::cerr << "Exception caught 04 writer
update !" << std::endl;<BR> std::cerr << exp
<< std::endl;<BR> }<BR> printf("All done\n");<BR> return
(0);<BR>}<BR></DIV>
<DIV dir=ltr> </DIV>
<DIV dir=ltr> </DIV>
<DIV dir=ltr> </DIV></DIV></BODY></HTML>