]> Creatis software - bbtk.git/commitdiff
*** empty log message ***
authorguigues <guigues>
Tue, 1 Apr 2008 12:26:03 +0000 (12:26 +0000)
committerguigues <guigues>
Tue, 1 Apr 2008 12:26:03 +0000 (12:26 +0000)
kernel/appli/bbfy/bbfy.cpp
packages/itk/bbs/boxes/bbDICOMDirReader.bbs [new file with mode: 0644]
packages/itk/src/bbitkDICOMSeriesFileNames.xml [new file with mode: 0644]
packages/wxvtk/bbs/boxes/bbSimpleSlicer.bbs

index dce426a908dcd6538865332f9e9f692a85630a94..0d7804033d4b412ba4c4c24de1f68afda858c7b1 100644 (file)
@@ -77,6 +77,7 @@ private:
   std::string mTemplateImplementation;
 
   std::vector<std::string> mInclude;
+  std::vector<std::string> mTypedef;
 
   std::string mUserConstructor;
   std::string mUserCopyConstructor;
@@ -326,6 +327,13 @@ void bbfy::ParseXML()
       bbtk::GetTextOrClear(BB.getChildNode("include",&j),val);
       mInclude.push_back(val);
     }
+  // Typedef
+  for (i=0,j=0; i<BB.nChildNode("typedef"); i++) 
+    {
+      std::string val;
+      bbtk::GetTextOrClear(BB.getChildNode("typedef",&j),val);
+      mTypedef.push_back(val);
+    }
   
   // Inputs
   for (i=0,j=0; i<BB.nChildNode("input"); i++) 
@@ -539,6 +547,10 @@ void bbfy::CreateHeader()
       mFile << "  typedef " <<mVtkParent <<" vtkParent;"<<std::endl;
       mFile << "  void bbDelete() { vtkParent::Delete(); }"<<std::endl;
     }
+  for (i=mTypedef.begin(); i!=mTypedef.end(); ++i) 
+    {
+      mFile << *i <<"\n";
+    }
 
   // Declare user constructor / copy cons /destr 
   mFile << "//=================================================================="<<std::endl;
@@ -725,6 +737,11 @@ void bbfy::CreateHeader()
   
   // Category
   mFile << "BBTK_CATEGORY(\""<<mCategory<< "\");\n"; 
+
+  for (i=mTypedef.begin(); i!=mTypedef.end(); ++i) 
+    {
+      mFile << *i <<"\n";
+    }
   
   // Inputs
   for (ioi=mInput.begin(); ioi!=mInput.end(); ++ioi) 
diff --git a/packages/itk/bbs/boxes/bbDICOMDirReader.bbs b/packages/itk/bbs/boxes/bbDICOMDirReader.bbs
new file mode 100644 (file)
index 0000000..674554b
--- /dev/null
@@ -0,0 +1,15 @@
+load itk
+
+define DICOMDirReader itk
+  description "Reads a series from a DICOM directory as a 3D itk image" 
+  author "laurent.guigues at creatis.insa-lyon.fr"
+  category "image;read/write;dicom"
+
+  new DICOMSeriesFileNames dicom
+  new ImageSeriesReader reader
+  
+  input In dicom.In "The input DICOM directory"
+  output Out reader.Out "The image read"
+
+  exec reader
+endefine
diff --git a/packages/itk/src/bbitkDICOMSeriesFileNames.xml b/packages/itk/src/bbitkDICOMSeriesFileNames.xml
new file mode 100644 (file)
index 0000000..739bcdc
--- /dev/null
@@ -0,0 +1,54 @@
+<!--==========================================================================
+   STARTS THE DESCRIPTION OF THE BLACK BOX -->
+<blackbox name="DICOMSeriesFileNames">
+<!--=======================================================================-->
+
+  <!--========================================================================
+    THE BOX DOCUMENTATION -->
+  <author>laurent.guigues at creatis.insa-lyon.fr</author>
+  <description>Reads a DICOM directory and generates an ordered sequence of filenames based on the DICOM tags in the files. Files can be sorted based on image number, slice location, or patient position. The files in the specified directory are grouped by SeriesUID. The list of SeriesUIDs can be queried and the filenames for a specific series extracted.</description>
+  <category>read/write;image;dicom</category>
+  <!--=====================================================================-->
+
+  <!--========================================================================
+    #include directives to be put in the .h generated
+    There must be one tag per file to include
+    Here we include the standard header iostream.h -->
+  <include><PRE>itkDICOMSeriesFileNames.h</PRE></include>
+  <include><PRE>itkDICOMSeriesFileNames.h</PRE></include>
+  <!--=====================================================================-->
+
+  <!--========================================================================
+    INPUTS/OUTPUTS DECLARATION --> 
+  <!-- Declares an input with name 'In' -->
+  <input name="In" type="std::string" description="DICOM directory"/>
+  
+  <!-- Declares an output with name 'Out' -->
+  <typedef><PRE>typedef std::vector<std::string> OutputType;</PRE></typedef>
+  <output name="Out" type="OutputType" description="Vector of file names"/>
+  <!--=====================================================================-->
+
+  <!--========================================================================
+    THE PROCESSING METHOD BODY -->
+  <process><PRE>
+    itk::DICOMSeriesFileNames::Pointer names = 
+     itk::DICOMSeriesFileNames::New();
+    names->SetDirectory(bbGetInputIn()); 
+    bbSetOutputOut( names->GetFileNames() );
+  </PRE></process>
+  <!--=====================================================================-->
+
+  <!--========================================================================
+    CONSTRUCTORS / DESTRUCTORS (OPTIONAL) 
+  <constructor><PRE>
+  </PRE></constructor>    
+  <copyconstructor><PRE>
+  </PRE></copyconstructor>    
+  <destructor><PRE>
+  </PRE></destructor>    
+  <!--=====================================================================-->
+
+<!--=======================================================================-->
+<!-- END OF BLACK BOX DESCRIPTION -->
+</blackbox>
+<!--=======================================================================-->
index d1a3235fc5cf908e32ba2f220c3bba2d2f7e0b38..60db96bcc604d17af9a385c3e4e116bd4cf355a5 100644 (file)
@@ -2,7 +2,7 @@ load std
 load wx
 load wxvtk 
 
-define SimpleSlicer
+define SimpleSlicer wxvtk
 
  description "Simple 2D viewer of a slice of a 3D image. The slice is controlled by a slider. See <a href='#DemoSimpleSlicer'>DemoSimpleSlicer.bbs</a>. Screenshot : <center><img src='DemoSimpleSlicer.png'></center>"
  author "laurent.guigues@creatis.insa-lyon.fr"