]> Creatis software - bbtk.git/commitdiff
*** empty log message ***
authorguigues <guigues>
Fri, 15 Feb 2008 09:58:26 +0000 (09:58 +0000)
committerguigues <guigues>
Fri, 15 Feb 2008 09:58:26 +0000 (09:58 +0000)
packages/std/bbs/appli/exampleLoadHola.bbs [new file with mode: 0644]
packages/std/bbs/boxes/bbPrependPackageDataPath.bbs [new file with mode: 0755]
packages/vtk/bbs/boxes/bbLoadHola.bbs [new file with mode: 0644]
packages/vtk/data/hola.mhd [new file with mode: 0644]
packages/vtk/data/hola.raw [new file with mode: 0644]

diff --git a/packages/std/bbs/appli/exampleLoadHola.bbs b/packages/std/bbs/appli/exampleLoadHola.bbs
new file mode 100644 (file)
index 0000000..f74cdd3
--- /dev/null
@@ -0,0 +1,9 @@
+print "=== LoadHola box example ==="
+description "LoadHola box example"
+author "laurent.guigues at creatis.insa-lyon.fr"
+category "example"
+
+include util
+new LoadHola loader
+print "Path to the 'hola' image = '$loader.FileName$'"
+print "Image loaded             = $loader.Out$"
diff --git a/packages/std/bbs/boxes/bbPrependPackageDataPath.bbs b/packages/std/bbs/boxes/bbPrependPackageDataPath.bbs
new file mode 100755 (executable)
index 0000000..f55b8e7
--- /dev/null
@@ -0,0 +1,23 @@
+load std
+
+define PrependPackageDataPath util
+  author "laurent.guigues at creatis.insa-lyon.fr"
+  description "Prepends the input file name 'In' with the path to the data directory of the package 'Package'"
+  category "misc"
+
+  # For getting bbtk Data Path
+  new Configuration c
+  
+  # For making a full path name, avoiding troubles with / or \
+  new MakeFileName mfn1
+  new MakeFileName mfn2
+
+  connect c.DataPath mfn1.Directory
+  connect mfn1.Out mfn2.Directory  
+  
+  # inputs / outputs 
+  input  In   mfn2.File "Last Filename"
+  input  Package   mfn1.File "Package name"
+  output Out mfn2.Out   "Full path Filename"
+endefine
+
diff --git a/packages/vtk/bbs/boxes/bbLoadHola.bbs b/packages/vtk/bbs/boxes/bbLoadHola.bbs
new file mode 100644 (file)
index 0000000..58658f2
--- /dev/null
@@ -0,0 +1,18 @@
+load vtk
+include std/boxes/bbPrependPackageDataPath
+
+define LoadHola
+  description "Loads the image 'hola.mhd'" 
+  author "laurent.guigues at creatis.insa-lyon.fr"
+  category "image;read/write"
+
+  new MetaImageReader reader
+  new PrependPackageDataPath ppdp
+  set ppdp.In "hola.mhd"
+  set ppdp.Package "vtk"
+  connect ppdp.Out reader.In
+  output Out reader.Out "The image"
+  output FileName ppdp.Out "The path to the image loaded"
+
+endefine
diff --git a/packages/vtk/data/hola.mhd b/packages/vtk/data/hola.mhd
new file mode 100644 (file)
index 0000000..e1af6ff
--- /dev/null
@@ -0,0 +1,10 @@
+ObjectType = Image
+NDims = 3
+BinaryData = True
+BinaryDataByteOrderMSB = False
+ElementSpacing = 0.796875 0.796875 0.7
+DimSize = 112 131 192
+Position = 0 0 0
+ElementNumberOfChannels = 1
+ElementType = MET_USHORT
+ElementDataFile = hola.raw
diff --git a/packages/vtk/data/hola.raw b/packages/vtk/data/hola.raw
new file mode 100644 (file)
index 0000000..fbb1136
Binary files /dev/null and b/packages/vtk/data/hola.raw differ