[ITK] [ITK-users] [ITK Community] [Insight-users] Progress events and DiffusionTensor3DReconstructionImageFilter
Luis Ibanez
luis.ibanez at kitware.com
Wed Mar 19 11:07:10 EDT 2014
Hi Bogdan,
It seems that your email was sent from Nabble, instead of being
sent directly to the ITK mailing list, and as a result, the code snippet
was stripped. (Please submit your emails to the itk mailing list
directly, instead of sending them through Nabble.)
Let me paste the code snippet below:
-----------------------------------------------------
Here the code snippet:
typedef signed short TPixelType;
typedef itk::DiffusionTensor3DReconstructionImageFilter<TPixelType,
TPixelType> DiffusionTensorReconstructionFilterType;
DiffusionTensorReconstructionFilterType::Pointer
tensorReconstructionFilter =
DiffusionTensorReconstructionFilterType::New();
// Setup filter's reference and gradient images
// ...
MyCommand::Pointer myCommand = MyCommand::New();
tensorReconstructionFilter->AddObserver(itk::ProgressEvent(), myCommand);
tensorReconstructionFilter->SetBValue(bValue);
tensorReconstructionFilter->SetThreshold(thresholdValue);
tensorReconstructionFilter->SetNumberOfThreads(1);
tensorReconstructionFilter->Update();
-----------------------------------------------------
Your usage of the command observer seems to be correct here.
Adding the following change to the test of the
DiffusionTensor3DReconstructionImageFilter
git diff .
diff --git
a/Modules/Filtering/DiffusionTensorImage/test/itkDiffusionTensor3DReconstructionImageFilterTest.cxx
b/Modules/Filter
index c29509b..c2b9b3d 100644
---
a/Modules/Filtering/DiffusionTensorImage/test/itkDiffusionTensor3DReconstructionImageFilterTest.cxx
+++
b/Modules/Filtering/DiffusionTensorImage/test/itkDiffusionTensor3DReconstructionImageFilterTest.cxx
@@ -17,6 +17,7 @@
*=========================================================================*/
#include "itkDiffusionTensor3DReconstructionImageFilter.h"
#include "itkImageRegionIteratorWithIndex.h"
+#include "itkFilterWatcher.h"
#include <iostream>
int itkDiffusionTensor3DReconstructionImageFilterTest(int, char*[])
@@ -135,6 +136,8 @@ int
itkDiffusionTensor3DReconstructionImageFilterTest(int, char*[])
std::cout << std::endl << "This filter is using " <<
tensorReconstructionFilter->GetNumberOfThreads() << " threads " <<
std::endl;
+ FilterWatcher watcher( tensorReconstructionFilter, "Tensor
Reconstruction");
+
tensorReconstructionFilter->Update();
typedef TensorReconstructionImageFilterType::TensorImageType
TensorImageType;
Confirms that the progress reporting is not implemented,
since we get the following output
2: ITK test driver caught an ITK exception:
2:
2: itk::ExceptionObject (0x1fdfbf0)
2: Location: "unknown"
2: File:
/home/ibanez/src/ITK/Modules/Core/TestKernel/include/itkFilterWatcher.h
2: Line: 121
2: Description: itk::ERROR:
DiffusionTensor3DReconstructionImageFilter(0x7fff4f1c5570): Filter does not
have progress.
2:
The following patch should fix the issue:
http://review.source.kitware.com/#/c/14794/
It introduces the ProgressReporter class into the filter.
Thanks
Luis
On Fri, Mar 14, 2014 at 11:23 AM, Bodyagon <zubrolet at gmail.com> wrote:
> Hello, guys!
>
> I have a problem with observing
> itk::DiffusionTensor3DReconstructionImageFilter's progress events. It
> seems,
> that this filter doesn't send any itk::ProgressEvent objects to observer.
> In
> the filter's code I also didn't find any mention of itk::ProgressReporter
> or
> something related to progress.
>
> Here the code snippet:
>
> Could you tell me, is there anyway to observe this filter's progress? Or
> this filter is intended to work without any progress notification?
>
> Thanks,
> Bogdan
>
>
>
>
> --
> View this message in context:
> http://itk-insight-users.2283740.n2.nabble.com/Progress-events-and-DiffusionTensor3DReconstructionImageFilter-tp7585190.html
> Sent from the ITK Insight Users mailing list archive at Nabble.com.
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.php
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users
> _______________________________________________
> Community mailing list
> Community at itk.org
> http://public.kitware.com/cgi-bin/mailman/listinfo/community
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/community/attachments/20140319/57e92bce/attachment-0002.html>
-------------- next part --------------
_____________________________________
Powered by www.kitware.com
Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html
Kitware offers ITK Training Courses, for more information visit:
http://www.kitware.com/products/protraining.php
Please keep messages on-topic and check the ITK FAQ at:
http://www.itk.org/Wiki/ITK_FAQ
Follow this link to subscribe/unsubscribe:
http://www.itk.org/mailman/listinfo/insight-users
More information about the Community
mailing list