Hi Andreas,

On Fri, Feb 3, 2012 at 12:05 PM, Fetzer, Andreas <
[email protected]> wrote:

> Hi Miklos,
>
> I'm not quiet sure since I have not work with 3D+t Image so far but I
> think this might be a bug in the SliceNavigationController::Update()
> method. Could you please check/debug the values that are set in line
> 268-300? Does the worldTimeSlicedGeometry->GetTimeSteps deliver you the
> right number (i.e. 6)?
>

No, it returns 11.
Maybe, I set up the geometry incorrectly. This is the only image in the
data storage.

I used the code below to set up the geometry. The "originalTimes" array
contains the acquisition times in milliseconds, relative to the first
acquisition. I have only the start time, not the end. As end time, I set
the start time of the next time step, and a somewhat latter time for the
last time step.

  mitk::TimeSlicedGeometry* tsgeom = image->GetTimeSlicedGeometry();
  tsgeom->SetEvenlyTimed(false);
  double finishTime = originalTimes[timeSteps - 1] * 2 -
originalTimes[timeSteps - 2];
  mitk::TimeBounds tsTimeBounds;
  tsTimeBounds[0] = 0.0;
  tsTimeBounds[1] = finishTime;
  tsgeom->SetTimeBounds(tsTimeBounds);

  mitk::Geometry3D* geom;
  unsigned i;
  for (i = 0; i < timeSteps - 1; ++i) {
    geom = tsgeom->GetGeometry3D(i);
    mitk::TimeBounds timeBounds = geom->GetTimeBounds();
    timeBounds[0] = originalTimes[i];
    timeBounds[1] = originalTimes[i + 1];
    geom->SetTimeBounds(timeBounds);
  }

  geom = tsgeom->GetGeometry3D(i);
  mitk::TimeBounds lastTimeBounds = geom->GetTimeBounds();
  lastTimeBounds[0] = originalTimes[i];
  lastTimeBounds[1] = finishTime;
  geom->SetTimeBounds(lastTimeBounds);

Right before this code I printed "image->GetTimeSteps()". It returned 6.

Is it correct? Did I miss something?

Thank you,
Miklos
------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users

Reply via email to