std::string mTemplateImplementation;
std::vector<std::string> mInclude;
+ std::vector<std::string> mTypedef;
std::string mUserConstructor;
std::string mUserCopyConstructor;
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++)
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;
// 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)
--- /dev/null
+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
--- /dev/null
+<!--==========================================================================
+ 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>
+<!--=======================================================================-->