[Insight-users] SmartPointer problem
Benjamin King
king . benjamin at mh-hannover . de
Tue, 26 Aug 2003 10:30:03 +0100
------------HRZ0iFgYNoPCoz9kuY1Gne
Content-Type: text/plain; charset=iso-8859-15; format=flowed
Hi all,
my question has already been asked and answered
(http://www . itk . org/pipermail/insight-users/2003-June/004124 . html), but the
solution doesn't work for me.
I just want to wrap a part of the pipeline in a function but I'm struggling
with smart pointer semantics. In the attached code you see that I already
return ImageType::Pointer instead of just a plain ImageType*, but no output
is being generated.
Any help is much appreciated.
Best regards,
Benjamin
--
Benjamin King
Institut für Medizinische Informatik
Medizinische Hochschule Hannover
Tel.: +49 511 532-2663
------------HRZ0iFgYNoPCoz9kuY1Gne
Content-Disposition: attachment;
filename="DebugReturnValue.cpp"
Content-Type: application/octet-stream;
name="DebugReturnValue.cpp"
Content-Transfer-Encoding: Base64
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSAiaXRrVGhyZXNob2xkSW1h
Z2VGaWx0ZXIuaCIKI2luY2x1ZGUgIml0a1JhbmRvbUltYWdlU291cmNlLmgi
CiNpbmNsdWRlICJpdGtJbWFnZS5oIgoKdGVtcGxhdGUgPGNsYXNzIEltYWdl
VHlwZT4KdHlwZW5hbWUgSW1hZ2VUeXBlOjpQb2ludGVyIHNvbWVGdW5jdGlv
bihJbWFnZVR5cGUqIGltYWdlKSB7CiAgdHlwZWRlZiBpdGs6OlRocmVzaG9s
ZEltYWdlRmlsdGVyPEltYWdlVHlwZT4gVHJlc2hvbGRUeXBlOwogIHR5cGVu
YW1lIFRyZXNob2xkVHlwZTo6UG9pbnRlciB0aHJlc2hvbGQgPSBUcmVzaG9s
ZFR5cGU6Ok5ldygpOwoKICB0aHJlc2hvbGQtPlNldElucHV0KGltYWdlKTsK
ICByZXR1cm4gdGhyZXNob2xkLT5HZXRPdXRwdXQoKTsKfQoKaW50IG1haW4o
KSB7CiAgdHlwZWRlZiBpdGs6OkltYWdlPHVuc2lnbmVkIHNob3J0LCAzPiB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