]> Creatis software - creaMaracasVisu.git/commitdiff
#3568 ReadCreaContourFile return empty list if the file not exists, after second...
authoreduardo.davila@creatis.insa-lyon.fr <eduardo.davila@creatis.insa-lyon.fr>
Mon, 18 Nov 2024 13:14:11 +0000 (14:14 +0100)
committereduardo.davila@creatis.insa-lyon.fr <eduardo.davila@creatis.insa-lyon.fr>
Mon, 18 Nov 2024 13:14:11 +0000 (14:14 +0100)
bbtk/src/bbcreaMaracasVisuReadCreaContourFile.cxx

index 7e371210b0fd1f741f498edf317b6b8c53ed5a74..a22888e7c6a99bb499f4f5d7e3e08ba6525d7d6b 100644 (file)
@@ -29,6 +29,12 @@ void ReadCreaContourFile::Process()
 //    bbSetOutputOut( bbGetInputIn() );
 //    std::cout << "Output value = " <<bbGetOutputOut() << std::endl;
   
+    
+    std::vector<double> LstX;
+    std::vector<double> LstY;
+    std::vector<double> LstZ;
+    std::vector<int>     LstIndexs;
+
        if (bbGetInputFileNameRoi().compare("")==0)
        {
                printf("EED Warnning!  ReadCreaContourFile::Process  FileNameRoi  EMPTY\n");
@@ -49,13 +55,6 @@ void ReadCreaContourFile::Process()
                                double x,y,z,zz;
                                int TypeModel;
                                int NumberOfControlPoints;
-
-
-                               std::vector<double> LstX;
-                               std::vector<double> LstY;
-                               std::vector<double> LstZ;
-                               std::vector<int>        LstIndexs;
-
                                fscanf(ff,"%s",tmp);    // version
                                fscanf(ff,"%s",tmp);    // 
                                fscanf(ff,"%s",tmp);    // ImageDimensions
@@ -114,19 +113,18 @@ void ReadCreaContourFile::Process()
 
                                } // for i  NumberOfContours
                                fclose(ff);
-                       bbSetOutputLstX( LstX );
-                       bbSetOutputLstY( LstY );
-                       bbSetOutputLstZ( LstZ );
-                       bbSetOutputLstIndexs( LstIndexs );
-
                        } else {
                                                printf("EED Warnning!  ReadCreaContourFile::Process  %s is not a creaContour .roi file\n",bbGetInputFileNameRoi().c_str() );
                        } // if --CreaContour--
                } // if ff
        } // if FileNameRoi
-
+    bbSetOutputLstX( LstX );
+    bbSetOutputLstY( LstY );
+    bbSetOutputLstZ( LstZ );
+    bbSetOutputLstIndexs( LstIndexs );
 }
-//===== 
+
+//=====
 // 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)
 //===== 
 void ReadCreaContourFile::bbUserSetDefaultValues()