From: guigues Date: Fri, 15 Feb 2008 09:58:26 +0000 (+0000) Subject: *** empty log message *** X-Git-Tag: r0.6.1~198 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=e7d560862465ba0c2bf23c1c2e8e5fb0b7516ffe;p=bbtk.git *** empty log message *** --- diff --git a/packages/std/bbs/appli/exampleLoadHola.bbs b/packages/std/bbs/appli/exampleLoadHola.bbs new file mode 100644 index 0000000..f74cdd3 --- /dev/null +++ b/packages/std/bbs/appli/exampleLoadHola.bbs @@ -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 index 0000000..f55b8e7 --- /dev/null +++ b/packages/std/bbs/boxes/bbPrependPackageDataPath.bbs @@ -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 index 0000000..58658f2 --- /dev/null +++ b/packages/vtk/bbs/boxes/bbLoadHola.bbs @@ -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 index 0000000..e1af6ff --- /dev/null +++ b/packages/vtk/data/hola.mhd @@ -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 index 0000000..fbb1136 Binary files /dev/null and b/packages/vtk/data/hola.raw differ