[Insight-users] Median: different result on different machines

Luis Ibanez luis.ibanez at kitware.com
Mon Aug 22 19:42:27 EDT 2005


Hi Robert

Are you using the same compilers ?
same versions of GCC ?

Do you have the same compilation options in
both machines ?

E.g. a typical explanation would be if
one machine is building for Release and
the other for Debug.

Since your images are of pixel type "float"
they are prone to computation errors.


Is  your Machine 2, a 64-bits processor ?
and your Machine 1, a 32-bits processor ?


Your description of speckly is a bit intriguing...
could you post a screenshot of the images in question
in a public web site from where we could take a look
at it ?  Hopefully together with the screenshot of
the normal appearance ?


Thanks


   Luis



-----------------------
Atwood, Robert C wrote:
>  
> 
> ------------------------------------------------------------------------
> *From:* Atwood, Robert C
> *Sent:* Thu 11/08/2005 19:06
> *To:* ITK Mailing List
> *Subject:* Median: different result on different machines
> 
> Dear ITK list:
>  
> 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
>  
> ImageFileReader ---> MedianImageFilter ---> ImageFileWriter
>  
> Machine 1:  Intel p4 2800 , RedHat enterprise WS-3 + online up2date, ITK 
> from a few weeks ago cvs
>  
> 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.
>  
>  
> On machine 1 the median result looks correct (here it is hard-coded 
> radius 3 jsut to try)
>  
> On machine 2 there is speckle noise that seems to appear as a result of 
> the median.
>  
> 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!
>  
> 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.
>  
> Thanks
> Robert
>  
>  
> (here's the code)
>  
>  
> #include <stdio.h>
> #include <string.h>
> #include <malloc.h>
> #include "itkImage.h"
> #include "itkImageFileWriter.h"
> #include "itkImageFileReader.h"
> #include "itkMedianImageFilter.h"
>   typedef float PixelType;
>   typedef itk::Image< PixelType, 3 > ScalarImageType;
>   // definitions for writing the image
>   typedef itk::ImageFileWriter< ScalarImageType > WriterType;
>   typedef itk::ImageFileReader<ScalarImageType> ReaderType;
>   //median filter
>   typedef itk::MedianImageFilter<ScalarImageType,ScalarImageType> VolMedian;
> /*********************************/
> /* beginning of MAIN routine     */
> /*********************************/
> int main(int argc, char ** argv) {
>   int med_rad=3;
>   /* ITK objects needed for processing the volume  */
>   VolMedian::Pointer volmedian = VolMedian::New();
>   ReaderType::Pointer reader = ReaderType::New();
>   WriterType::Pointer writer = WriterType::New();
>   ScalarImageType::SizeType vol_rad;
>   if (argc != 2){
>       printf("Little program to test itk median filter\n");
>       printf("Usage: %s input.mhd\n",argv[0]);
>       printf("Only itk registered data file types to avoid extra\n");
>       printf("import filter code.\n");
>       printf("Median radius fixed at %i\n",med_rad);
>       return(0);
>   }
>   vol_rad[0] = med_rad;
>   vol_rad[1] = med_rad;
>   vol_rad[2] = med_rad;
>   volmedian->SetRadius(vol_rad);
>   printf("...3d Median ... itk radius %i ..\n",med_rad);
>   volmedian->SetInput(reader->GetOutput());
>      /* add the volume writer */
>   writer->SetInput(volmedian->GetOutput());
>   writer->SetFileName( "mediantest.mhd" );
>   reader->SetFileName(argv[1]);
>   try {
>      writer->Update();
>   }catch( itk::ExceptionObject & exp ) {
>      std::cerr << "Exception caught 04 writer update !" << std::endl;
>      std::cerr << exp << std::endl;
>   }
>   printf("All done\n");
>   return (0);
> }
>  
>  
>  
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users



More information about the Insight-users mailing list