]> Creatis software - creaImageIO.git/commitdiff
warning: passing NULL to non-pointer
authorjean-pierre roux <jean-pierre.roux@creatis.insa-lyon.fr>
Wed, 27 Jul 2011 14:15:45 +0000 (14:15 +0000)
committerjean-pierre roux <jean-pierre.roux@creatis.insa-lyon.fr>
Wed, 27 Jul 2011 14:15:45 +0000 (14:15 +0000)
bbtk/src/bbcreaImageIOItkImagesChooserDialogBox.cxx

index 66f810ac388c742f1f5d828f80daddc18ab27c38..6872d3785b942b580128e84a4f7ce530ea897e0e 100644 (file)
@@ -16,38 +16,41 @@ BBTK_BLACK_BOX_IMPLEMENTATION(ItkImagesChooserDialogBox,bbtk::AtomicBlackBox);
 void ItkImagesChooserDialogBox::Process()
 {
  
-       dlg = new creaImageIO::WxAnySimpleDlg(0,crea::std2wx(bbGetInputTitle()),"localdatabase_Descriptor.dscp","Local Database"); 
+    dlg = new creaImageIO::WxAnySimpleDlg(0,crea::std2wx(bbGetInputTitle()),"localdatabase_Descriptor.dscp","Local Database"); 
     dlg->ShowModal(); 
 
-       bbtk::TypeInfo typ = bbitk::GetITKImagePtrTypeInfoFromPixelTypeInfoAndDimension(*dlg->getTypes().front(), dlg->getDims().front());
-       BBTK_TEMPLATE_ITK_IMAGE_SWITCH(typ, Export);
-       BBTK_TEMPLATE_ITK_IMAGE_SWITCH(typ, ExportVTK);
-       
-       delete dlg;
+    bbtk::TypeInfo typ = bbitk::GetITKImagePtrTypeInfoFromPixelTypeInfoAndDimension(*dlg->getTypes().front(), dlg->getDims().front());
+    BBTK_TEMPLATE_ITK_IMAGE_SWITCH(typ, Export);
+    BBTK_TEMPLATE_ITK_IMAGE_SWITCH(typ, ExportVTK);
+
+    delete dlg;
 }
+
 template <class TImage>
 void ItkImagesChooserDialogBox::Export()
 {
-        if (dlg->getImagesSelected().size() == 1)
-        
+   if (dlg->getImagesSelected().size() == 1)
+   { 
                bbSetOutputOut( dlg->getTemplatedImagesSelected<TImage>().front().GetPointer() ); 
-        } 
-         else if (dlg->getImagesSelected().size() > 1)
-         { 
-                 OutputImagesITKType outVect;
-               
-                 typename  std::vector<typename TImage::Pointer> tempImgs= dlg->getTemplatedImagesSelected<TImage>();
-                 typename std::vector<typename TImage::Pointer>::iterator it = tempImgs.begin();
-                 for(;it != tempImgs.end(); ++it)
-                 {
-                         outVect.push_back( (*it).GetPointer() );
-                 }
-               bbSetOutputOutIImages( outVect); 
-      } 
-         else
-         {
-               bbSetOutputOut( NULL); 
-         }
+   } 
+   else if (dlg->getImagesSelected().size() > 1)
+   { 
+      OutputImagesITKType outVect;
+
+      typename  std::vector<typename TImage::Pointer> tempImgs= dlg->getTemplatedImagesSelected<TImage>();
+      typename std::vector<typename TImage::Pointer>::iterator it = tempImgs.begin();
+      for(;it != tempImgs.end(); ++it)
+      {
+         outVect.push_back( (*it).GetPointer() );
+      }
+      bbSetOutputOutIImages( outVect); 
+   } 
+   else
+   {
+      // warning: passing NULL to non-pointer 
+      //bbSetOutputOut( NULL);
+      bbSetOutputOut(0); // JPR
+   }
         // FCY To test the Output
          //typedef itk::Image <short, 3> ImageType;
         //typedef itk::ImageFileReader< ImageType > itkReaderType;
@@ -73,16 +76,16 @@ void ItkImagesChooserDialogBox::ExportVTK()
                  bbSetOutputOutVImages( dlg->getVtkImagesSelected() ); 
         } 
         else if (dlg->getDims().front() == 4)
-         
+        { 
                // To Test
                 //  dlg->split4Din3Dvtk("d:/temp2");
                 // bbSetOutputOutVImages( dlg->getVtkImagesSelected()); 
-      } 
-         else
-         {
+         
+        else
+        {
                  // NOT IMPLEMENTED YET FOR DIMENSIONS > 4
-               
-         }
+       
+        }
         
 }
 //===== 
@@ -91,8 +94,6 @@ void ItkImagesChooserDialogBox::ExportVTK()
 void ItkImagesChooserDialogBox::bbUserSetDefaultValues()
 {
  
-  
 }
 //===== 
 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
@@ -110,5 +111,3 @@ void ItkImagesChooserDialogBox::bbUserFinalizeProcessing()
 }
 }
 // EO namespace bbcreaImageIO
-
-