Dear Hila,
I could not reproduce the bug on Linux, but a colleague of mine is going
to look into this next week.
Regarding your first question, the code you pasted here is realizing the
trilinear interpolation for the current position.
Regarding your second issue, I'm not sure waht your are trying to do.
You got an image (T1) and you want the TDI to be of the same size etc.?
This should be accomplished by selceting the T1 as reference image. If
you don't select the reference image, the fiber bundle geometry is used
for the output image.
If you want the output image to have the same geometry as your T1 iamge,
no code change should be necessary.
Best
Peter
On 22.03.2012 11:08, Hila Hiler wrote:
Hi Peter,
The error wasreported <http://bugs.mitk.org/show_bug.cgi?id=11289>.
If you don't mind, one more question regarding the algorithm:
would you please explain this section (that was taken from your code)?
utImageBufferPointer[( px + w*(py + h*pz ))] += ( frac_x)*(
frac_y)*( frac_z);
outImageBufferPointer[( px + w*(py+1+ h*pz ))] += (
frac_x)*(1-frac_y)*( frac_z);
outImageBufferPointer[( px + w*(py + h*pz+h))] += (
frac_x)*( frac_y)*(1-frac_z);
outImageBufferPointer[( px + w*(py+1+ h*pz+h))] += (
frac_x)*(1-frac_y)*(1-frac_z);
outImageBufferPointer[( px+1 + w*(py + h*pz ))] +=
(1-frac_x)*( frac_y)*( frac_z);
outImageBufferPointer[( px+1 + w*(py + h*pz+h))] +=
(1-frac_x)*( frac_y)*(1-frac_z);
outImageBufferPointer[( px+1 + w*(py+1+ h*pz ))] +=
(1-frac_x)*(1-frac_y)*( frac_z);
outImageBufferPointer[( px+1 + w*(py+1+ h*pz+h))] +=
(1-frac_x)*(1-frac_y)*(1-frac_z);
Second, regarding the code manipulation:
I got an intensity image by inserting just the .fib file (without the
m_selected_Image (that I assume generates an output image due to its
size, origin etc.). But the output image isn't as my required size
(which is obious because no reference image was insereted).
so I tried to remove these lines:
upsampledRegion.SetSize(0,
geometry->GetExtent(0)*m_UpsamplingFactor);
upsampledRegion.SetSize(1,
geometry->GetExtent(1)*m_UpsamplingFactor);
upsampledRegion.SetSize(2,
geometry->GetExtent(2)*m_UpsamplingFactor);
with these:
upsampledRegion = m_InputImage->GetLargestPossibleRegion();
typename OutputImageType::RegionType::SizeType size =
upsampledRegion.GetSize();
size[0] *= m_UpsamplingFactor;
size[1] *= m_UpsamplingFactor;
size[2] *= m_UpsamplingFactor;
upsampledRegion.SetSize(size);
and insert the reference image which is aligned with the fibers data
(actually it's T1_no_Gad)
but I got the attached error.
I'd to mention that if no image is selected, and the following code is
run,*the output image is correct*! but its dimensions are a problem
(in order to run my code, I need the same dimensions as the T1_no_Gad
because I run in parallel iterators on several images).
* do you have any idea how I can change the size of that output image?
The code:
newSpacing = geometry->GetSpacing()/m_UpsamplingFactor;
newOrigin = geometry->GetOrigin();
mitk::Geometry3D::BoundsArrayType bounds = geometry->GetBounds();
newOrigin[0] += bounds.GetElement(0);
newOrigin[1] += bounds.GetElement(2);
newOrigin[2] += bounds.GetElement(4);
for (int i=0; i<3; i++)
for (int j=0; j<3; j++)
newDirection[j][i] = geometry->GetMatrixColumn(i)[j];
upsampledRegion.SetSize(0,
geometry->GetExtent(0)*m_UpsamplingFactor);
upsampledRegion.SetSize(1,
geometry->GetExtent(1)*m_UpsamplingFactor);
upsampledRegion.SetSize(2,
geometry->GetExtent(2)*m_UpsamplingFactor);
Many Thanks!
Hila
On Thu, Mar 22, 2012 at 10:36 AM, Peter Neher
<[email protected] <mailto:[email protected]>> wrote:
Hi Hila,
we use the upsampling to ensure that no voxel that is crossed by a
fiber is left out. This might happen if the distance between two
points on the fiber is too large. And as said in my previous
email, the filter does not calculate the number of fibers per
voxel. But if desired it could easily be redesigned to do so. Just
visit each voxel only once per fiber and skip the normalization step.
Regarding the runtime error you encountered, could you ad a bug to
our bugtracker and upload the according .fib needed to reproduce
the bug? I will have a look at it in the next couple of days.
Best
Peter
On 21.03.2012 10 <tel:21.03.2012%2010>:58, Hila Hiler wrote:
In addition,
I investigated the code of itkTractDensityImageFilter and wondered :
why is the up-sampling necessary ? I guess that the connection
between density and upsampling isn't comprehensible for me. and
however, how is the sampling correlated to your algorithm
description (that measures number of fibers per a voxel)?
any information or links to data sources would be very helpful.
Best,
Hila
On Tue, Mar 20, 2012 at 10:45 AM, Hila Hiler <[email protected]
<mailto:[email protected]>> wrote:
I'm starting to wonder whether the data of fibers that
inserted is incorrect, although I generated the .fib file as
suggested.
And the bar "fiber bundle statistics" presents:
fibers
Number of fibers: 10000
Mean fiber length: 7.01857cm
Median fiber length: 6.93052cm
Standard deviation: 5.39865cm
But still I got that run time error that is illustrated in
the attached file.
now I can't do nothing with this module because the same
error represented in each application...
What's the reason for this?
Regards,
Hila
On Mon, Mar 19, 2012 at 10:44 AM, Hila Hiler
<[email protected] <mailto:[email protected]>> wrote:
Thank you Peter.
I tried to use the GUI in order to generate a density
image but I encountered with a run time error that
indicates about an access violation reading location in:
vtkIdType GetNumberOfPoints() {return
this->Data->GetNumberOfTuples();}
any ideas?
On Sun, Mar 18, 2012 at 10:24 AM, Peter Neher
<[email protected]
<mailto:[email protected]>> wrote:
Dear Hila,
we basically walk along the fiber and increase the
grey value of each encountered voxel. Afterwards
everything is normalized to one. So you don't get
absolute values how many fibers are passing each
voxel but an indicator of where are many and where
are only few fibers in the image.
The filter is called in
QmitkFiberProcessingView::GenerateTractDensityImage
so you can use that as a reference. The simplest
example would be the following:
itk::TractDensityImageFilter< float >::Pointer
generator = itk::TractDensityImageFilter< float >::New();
generator->SetFiberBundle(fib);
generator->Update();
where fib is a mitk::FiberBundleX::Pointer.
Best
Peter
On 16.03.2012 18:28, Hila Hiler wrote:
Thank you!
would you please explain :
- how this filter works (a brief description of
the algorithm) ?
- example of how to use this filter ? (which
inputs to insert, how to get the output ...)
many thanks in advance ...
Best,
Hila
On Thu, Mar 15, 2012 at 6:32 PM, Peter Neher
<[email protected]
<mailto:[email protected]>> wrote:
Actually I recently changed the name to
itk::TractDensityImageFilter.
On 15.03.2012 13:20, Fritzsche, Klaus H. wrote:
Dear Hila,
die you see the
itk::TractsToProbabilityImageFilterin
Modules/DiffusionImaging/Algorithms?
Best
Klaus
*Von:*Hila Hiler [mailto:[email protected]]
*Gesendet:* Donnerstag, 15. März 2012 12:54
*An:* Neher, Peter
*Cc:* [email protected]
<mailto:[email protected]>
*Betreff:* [mitk-users] Fwd: need advice:
measurement of density of fibers
Dear Peter, Mitk's users
Would you please consider my question?
any ideas/thoughts would be very appreciated!
It's obvious that the density equation is:
[samples/volume]*[samples/fiber]
but I'm afraid it's not the right aspect to
this challenge.
maybe the bundle color’s gradients can provide
any helpful details?
Best,
Hila
---------- Forwarded message ----------
From: *Hila Hiler* <[email protected]
<mailto:[email protected]>>
Date: Sat, Mar 10, 2012 at 10:10 PM
Subject: need advice: measurement of density of
fibers
To: [email protected]
<mailto:[email protected]>
Hi all,
How I can calculate the fibers density from a
.fib/.vtk 3d image ?
I thought to calculate it along it's direction
of longitude.
maybe I should consider to calculate the number
of fibers which are crossing an orthogonal plane?
another q: how I can achieve the gradient
value which is represented as a color on the
.fib file?
--
Dipl.-Inform. Peter Neher
German Cancer Research Centre
(DKFZ, Deutsches Krebsforschungszentrum in der
Helmholtz-Gemeinschaft, Stiftung des öffentlichen Rechts)
Division of Medical and Biological Informatics
Im Neuenheimer Feld 280, D-69120 Heidelberg
Phone: 49-(0)6221-42-3552, Fax: 49-(0)6221-42-2345
E-Mail:[email protected]
<mailto:[email protected]>, Web:www.dkfz.de <http://www.dkfz.de>
The information contained in this message may be confidential
and legally protected under applicable law. The message is intended solely for
the addressee(s). If you are not the intended recipient, you are hereby
notified that any use, forwarding, dissemination, or reproduction of this
message is strictly prohibited and may be unlawful. If you are not the intended
recipient, please contact the sender by return e-mail and destroy all copies of
the original message.
--
Dipl.-Inform. Peter Neher
German Cancer Research Centre
(DKFZ, Deutsches Krebsforschungszentrum in der Helmholtz-Gemeinschaft,
Stiftung des öffentlichen Rechts)
Division of Medical and Biological Informatics
Im Neuenheimer Feld 280, D-69120 Heidelberg
Phone: 49-(0)6221-42-3552, Fax: 49-(0)6221-42-2345
E-Mail:[email protected] <mailto:[email protected]>,
Web:www.dkfz.de <http://www.dkfz.de>
The information contained in this message may be confidential and legally
protected under applicable law. The message is intended solely for the
addressee(s). If you are not the intended recipient, you are hereby notified
that any use, forwarding, dissemination, or reproduction of this message is
strictly prohibited and may be unlawful. If you are not the intended recipient,
please contact the sender by return e-mail and destroy all copies of the
original message.
--
Dipl.-Inform. Peter Neher
German Cancer Research Centre
(DKFZ, Deutsches Krebsforschungszentrum in der Helmholtz-Gemeinschaft, Stiftung
des öffentlichen Rechts)
Division of Medical and Biological Informatics
Im Neuenheimer Feld 280, D-69120 Heidelberg
Phone: 49-(0)6221-42-3552, Fax: 49-(0)6221-42-2345
E-Mail: [email protected], Web: www.dkfz.de
The information contained in this message may be confidential and legally
protected under applicable law. The message is intended solely for the
addressee(s). If you are not the intended recipient, you are hereby notified
that any use, forwarding, dissemination, or reproduction of this message is
strictly prohibited and may be unlawful. If you are not the intended recipient,
please contact the sender by return e-mail and destroy all copies of the
original message.
------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users