View Issue Details

IDProjectCategoryView StatusLast Update
0003672Slicer4Core: Diffusion and Tractography (Any modules)public2017-06-10 08:51
Reporteralexy Assigned Tonicole  
PrioritynormalSeverityminorReproducibilityhave not tried
Status closedResolutionfixed 
Product Version 
Target VersionSlicer 4.4.0Fixed in VersionSlicer 4.4.0 
Summary0003672: tractography display have multiple issues
Description

From Lauren O'Donnell:

For a 2-tensor dataset

Issue 1. Display Wierdness
Sometimes the Tensor Property (everything on this menu, FA, etc) only shows red. Also, for me, sometimes the “color fibers by” were red as well (not now). The “scalar value” from the polydata seems okay. Also odd stuff happens on Alex’s computer with colors and window level…. Seems random????

Issue 2. Scalars stored by UKF (WTF)
FA and FA2 are created by default in UKF. I would assume they are from first and second tensor. But they don’t seem to correspond to Slicer’s FA (for many reasons maybe). The naming convention must be clarified, regardless, if it is FA or average or what. My recommendation is FA of each tensor. Anyway, please clarify.

What is the norm? Set it to something useful please.

What is the field called 1?

Issue 3. Eigenvectors
The major and middle eigenvectors are parallel, also their scaling is incorrect. The minor one, it’s not clear if it is correct but it might be. For UKF, the second and third eigenvalues are forced equal, so the scaling of the medium and minor eigenvectors should be the same.

Issue 4. Scalar Range
The scalar range doesn’t seem to update when data change. For scalar values in the polydata

There are two tensors called '1' and '2'. It would be best if the default is the first tensor field -- so somehow the one named '2' is default in slicer in order to calculate FA, etc. which would confuse any clinical user who assumes the thing being shown corresponds to the tensor that was followed. Not sure if this should be done according to a special name, or if there is any way in the file to say which should be active....

TagsNo tags attached.

Relationships

related to 0003734 closedinorton Range check error when switching between scalar values on fibre bundles 

Activities

alexy

alexy

2014-04-26 09:33

developer   ~0011672

The same issues are observed for singe tensor tracts

alexy

alexy

2014-04-29 06:50

developer   ~0011675

I tracked this issue to the change in the vtkMRMLModelDisplayableManager made by Nicole:
http://viewvc.slicer.org/viewvc.cgi/Slicer4/trunk/Libs/MRML/DisplayableManager/vtkMRMLModelDisplayableManager.cxx?r1=23021&r2=23083

alexy

alexy

2014-04-29 06:53

developer   ~0011676

Nicole, your change in vtkMRMLModelDisplayableManager broke the coloring of fibers, see note 0000001 from Lauren above.

nicole

nicole

2014-04-29 06:57

administrator   ~0011677

I'll look into issues 0000001 and 0000004.
Lauren: do you have a sample data set that you can attach to this bug?

2014-04-29 07:01

 

2_fiber.vtk (5,755 bytes)
alexy

alexy

2014-04-29 07:05

developer   ~0011678

Nicole, you can see the coloring issue on any fiber data 1 or 2 tensors (I uploaded a small 1-tensor dataset). If you switch between different tensor properties the color stays red. If you revert your change the colors are correct.
I will upload a 2-tensor data that has this issue when you switch between tensor and scalar property.

2014-04-29 07:05

 

glyphs_orig.vtk (2,245,438 bytes)
nicole

nicole

2014-05-02 07:56

administrator   ~0011687

Last edited: 2014-05-02 07:57

Having trouble reproducing various issues:

  • loading both .vtk files into Slicer via Add Data, each only has one display node, they were loaded as Model nodes (they're not showing up in the Tractography Display module)
  • in the Models module, 2_fibers only has one scalar overlay, 'tensors'
  • Models module: glyphs_orig has 1, 2, norm, FA, FA2 and switching between them with the default Data scalar range setting seems to be working correctly.

What steps am I missing?

lauren

lauren

2014-05-02 08:01

developer   ~0011688

Nicole you have to load them as fiber bundles.

lauren

lauren

2014-05-02 08:02

developer   ~0011689

And go to tractography display under diffusion.

nicole

nicole

2014-05-02 08:48

administrator   ~0011691

Thanks! Got it now. I don't work with the Slicer tractography functions very much.

nicole

nicole

2014-05-02 13:16

administrator   ~0011692

This check in should fix the first issue, I checked for fiber bundle display nodes and if present used the old system:
http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&revision=23118

For the fourth issue, where is the scalar range not updating? I see it updating in the Models, Display, Scalars, Active Scalar Range label.

lauren

lauren

2014-05-02 17:20

developer   ~0011693

This bug report only refers to issues in tractography display. No one uses models display for tracts. Hope this helps.

nicole

nicole

2014-05-05 11:43

administrator   ~0011694

For the scalar range update problem, are you referring to the Auto W/L section of the advanced display in the tractography display? If not, can you tell me where you're not seeing it update?

lauren

lauren

2014-05-05 11:52

developer   ~0011695

If you switch back and forth what is displayed (for example FA then something from the scalars in the vtk file) the W/L and the scalar display will do random strange things. At times only all-red tracts will be displayed. Just try displaying all the options and switching between them for a bit.

nicole

nicole

2014-05-05 12:11

administrator   ~0011697

After my check in, Julien's update for VTK6 and his fix of breaking my fix, I can't reproduce the all red tracts despite trying all the different scalars, and flipping between them and
My sense is that this is now a tractography display problem, the scalar ranges are updating properly when I double checked in the Models module, but I don't know how the W/L is calculated in the tractography display gui. I can see that it's not recalculating W/L when I switch the scalar value drop down. There may be a missing observation or pipeline update, but Alex would be the best person to check into it now.

alexy

alexy

2014-05-09 08:43

developer   ~0011713

It seems that the major regression has been fixed. I still see problems:
Issue 1. "color by scalar" not updating fiber colors when changing the scalar
Issue 3. Eigenvectors The major and middle eigenvectors are parallel, also their scaling is incorrect. The minor one, it’s not clear if it is correct but it might be. For UKF, the second and third eigenvalues are forced equal, so the scaling of the medium and minor eigenvectors should be the same. This is reproducible in Slicer 4.2 and looks like an old bug.

alexy

alexy

2014-05-09 11:24

developer   ~0011714

Fixed Issue 3 above.
At revision: 23147

alexy

alexy

2014-05-09 12:14

developer   ~0011715

Nicole, back to you with issue 1 above. It has to do with displaying scalars.
If you load glyphs_orig.vtk as fibers, go to Models module, check "Include Fibers" box, you should see the scalars in the GUI there. Changing between scalars has no effect on display.

nicole

nicole

2014-05-13 13:17

administrator   ~0011819

Debugging this, wrote some python code to inspect the scalars/chart the arrays:

g = getNode('glyphs_orig')
numDisp = g.GetNumberOfDisplayNodes()
for n in range(numDisp):
disp = g.GetNthDisplayNode(n)
print n,': scalar visib =',disp.GetScalarVisibility(),', active scalar = ',disp.GetActiveScalarName(), ', active tensor = ',disp.GetActiveTensorName()

pd = g.GetPolyData()
ptdata = pd.GetPointData()
numArrays = ptdata.GetNumberOfArrays()
for n in range(numArrays):
ar = ptdata.GetArray(n)
print n,' range = ',ar.GetRange()
dn = slicer.mrmlScene.AddNode(slicer.vtkMRMLDoubleArrayNode())
dn.SetName(ar.GetName())
dna = dn.GetArray()
numTuples = ar.GetNumberOfTuples()
dna.SetNumberOfTuples(numTuples)
for i in range(numTuples):
dna.SetComponent(i, 0, float(i))
dna.SetComponent(i, 1, ar.GetTuple(i)[0])
dna.SetComponent(i, 2, 0.0)

nicole

nicole

2014-05-16 12:24

administrator   ~0011873

Looks like the problem is in the UpdatePolyDataPipeline method of vtkMRMLFiberBundleDisplayNode and subclasses:

  • vtkMRMLFiberBundleDisplayNode doesn't call
    this->Superclass::UpdatePolyDataPipeline();
    which is where the scalar range is being updated on the display node (more testing needed, might not be necessary)
  • all the subclasses have very similar UpdatePolyDataPipeline in that they all make this call:
    this->GetInputPolyData()->GetScalarRange(range);
    instead of:
    range = this->GetOutputPolyData()->GetPointData()->GetArray(this->GetActiveScalarName())->GetRange()
    The scalar range on the poly data doesn't seem to change as the active scalar array changes, so it was getting set once and not reset to the proper value. This led to the scalar range on the display node not updating, and the model displayable manager is using that for the fiber bundles as per my last change to try and fix this. I'm not sure why nothing was changing in the 3d viewer, but with this change, it seems to work.

I'll have to make changes to the three subclasses to fix the scalar range calculation. Will post a github link for review.

nicole

nicole

2014-05-16 12:50

administrator   ~0011875

Also: I get an assert crash when flipping between various scalar options:

ASSERT: "d->equal(d->Slider->minimumValue(), d->MinimumSpinBox->value())" in file /Users/nicole/Slicer4-svn/Slicer-build-debug/CTK/Libs/Widgets/ctkRangeWidget.cpp, line 312

Load glyphs_orig.vtk as a fiber bundle
Tractography Display
Advanced display
Tubes visible
Of Scalar Value (default is FA2)
Change of scalar value to norm
Change of scalar value to 1

Partial stack trace:
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 libsystem_kernel.dylib 0x00007fff8e308212 __pthread_kill + 10
1 libsystem_c.dylib 0x00007fff8f7b6b54 pthread_kill + 90
2 libsystem_c.dylib 0x00007fff8f7fadce abort + 143
3 QtCore 0x00000001198249c5 qt_message_output(QtMsgType, char const) + 117
4 QtCore 0x0000000119824ba7 qt_message(QtMsgType, char const
, __va_list_tag) + 183
5 QtCore 0x0000000119824d6a qFatal(char const
, ...) + 170
6 libCTKWidgets.0.1.dylib 0x000000010f087f44 ctkRangeWidget::setRange(double, double) + 788 (ctkRangeWidget.cpp:312)
7 libqMRMLWidgets.dylib 0x000000010e9e7e27 qMRMLRangeWidget::updateRange() + 87 (qMRMLRangeWidget.cxx:136)
8 libqMRMLWidgets.dylib 0x000000010e9e7dbc qMRMLRangeWidget::updateSpinBoxRange(double, double) + 172 (qMRMLRangeWidget.cxx:129)
9 libqMRMLWidgets.dylib 0x000000010ea642b2 qMRMLRangeWidget::qt_metacall(QMetaObject::Call, int, void) + 274 (moc_qMRMLRangeWidget.cxx:98)
10 QtCore 0x000000011987ae26 QMetaObject::activate(QObject, QMetaObject const, int, void
) + 710
11 libCTKWidgets.0.1.dylib 0x000000010f0db6c5 ctkDoubleRangeSlider::rangeChanged(double, double) + 85 (moc_ctkDoubleRangeSlider.cxx:275)
12 libCTKWidgets.0.1.dylib 0x000000010f021e7a ctkDoubleRangeSlider::setRange(double, double) + 634 (ctkDoubleRangeSlider.cpp:341)
13 libCTKWidgets.0.1.dylib 0x000000010f087dc3 ctkRangeWidget::setRange(double, double) + 403 (ctkRangeWidget.cpp:309)
14 libqSlicerTractographyDisplayModuleWidgets.dylib 0x00000001338bd5af qSlicerTractographyDisplayWidget::updateScalarRange() + 351 (qSlicerTractographyDisplayWidget.cxx:661)
15 libqSlicerTractographyDisplayModuleWidgets.dylib 0x00000001338bc8f5 qSlicerTractographyDisplayWidget::updateWidgetFromMRML() + 2821 (qSlicerTractographyDisplayWidget.cxx:790)
16 libqSlicerTractographyDisplayModuleWidgets.dylib 0x00000001338c3bcb qSlicerTractographyDisplayWidget::qt_metacall(QMetaObject::Call, int, void) + 795 (moc_qSlicerTractographyDisplayWidget.cxx:148)
17 QtCore 0x000000011987ae26 QMetaObject::activate(QObject, QMetaObject const, int, void
) + 710
18 libCTKVisualizationVTKCore.0.1.dylib 0x0000000112339f1d ctkVTKConnection::emitExecute(vtkObject, void, unsigned long, void) + 125 (moc_ctkVTKConnection.cxx:106)
19 libCTKVisualizationVTKCore.0.1.dylib 0x0000000112322603 ctkVTKConnectionPrivate::execute(vtkObject
, unsigned long, void, void) + 915 (ctkVTKConnection.cpp:409)
20 libCTKVisualizationVTKCore.0.1.dylib 0x0000000112320759 ctkVTKConnectionPrivate::DoCallback(vtkObject, unsigned long, void, void) + 105 (ctkVTKConnection.cpp:369)
21 libvtkCommon.5.10.dylib 0x0000000125825a94 vtkCallbackCommand::Execute(vtkObject
, unsigned long, void) + 84 (vtkCallbackCommand.cxx:43)
22 libMRMLCore.dylib 0x00000001156e5dcf vtkEventBroker::InvokeObservation(vtkObservation
, unsigned long, void) + 255 (vtkEventBroker.cxx:842)
23 libMRMLCore.dylib 0x00000001156e563c vtkEventBroker::ProcessEvent(vtkObservation
, vtkObject, unsigned long, void) + 188 (vtkEventBroker.cxx:688)
24 libMRMLCore.dylib 0x00000001156e672b vtkEventBroker::Callback(vtkObject, unsigned long, void, void) + 507 (vtkEventBroker.cxx:914)
25 libvtkCommon.5.10.dylib 0x0000000125825a94 vtkCallbackCommand::Execute(vtkObject
, unsigned long, void) + 84 (vtkCallbackCommand.cxx:43)
26 libvtkCommon.5.10.dylib 0x000000012593143c vtkSubjectHelper::InvokeEvent(unsigned long, void
, vtkObject) + 2460 (vtkObject.cxx:620)
27 libvtkCommon.5.10.dylib 0x00000001259319e2 vtkObject::InvokeEvent(unsigned long, void
) + 66 (vtkObject.cxx:789)
28 libvtkCommon.5.10.dylib 0x0000000125931bc2 vtkObject::Modified() + 66 (vtkObject.cxx:856)
29 libMRMLCLI.dylib 0x00000001155fc463 vtkMRMLNode::InvokePendingModifiedEvent() + 67 (vtkMRMLNode.h:381)
30 libMRMLCLI.dylib 0x00000001155f826c vtkMRMLNode::EndModify(int) + 60 (vtkMRMLNode.h:228)
31 libMRMLCore.dylib 0x00000001157b14f9 vtkMRMLModelDisplayNode::SetActiveScalarName(char const*) + 121 (vtkMRMLModelDisplayNode.cxx:154)
32 libqSlicerTractographyDisplayModuleWidgets.dylib 0x00000001338bd24f qSlicerTractographyDisplayWidget::onColorByScalarChanged(int) + 271 (qSlicerTractographyDisplayWidget.cxx:369)
33 libqSlicerTractographyDisplayModuleWidgets.dylib 0x00000001338c3a12 qSlicerTractographyDisplayWidget::qt_metacall(QMetaObject::Call, int, void) + 354 (moc_qSlicerTractographyDisplayWidget.cxx:130)
34 QtCore 0x000000011987ae26 QMetaObject::activate(QObject, QMetaObject const, int, void
) + 710
35 QtGui 0x0000000118f5c1f0 QComboBox::currentIndexChanged(int) + 48
36 QtGui 0x0000000118f5dbcc QComboBoxPrivate::_q_emitCurrentIndexChanged(QModelIndex const&) + 44
37 QtGui 0x0000000118f6085e QComboBoxPrivate::setCurrentIndex(QModelIndex const&) + 254
38 QtGui 0x0000000118f60c95 QComboBoxPrivate::_q_itemSelected(QModelIndex const&) + 69
39 QtGui 0x0000000118f659da QComboBox::qt_metacall(QMetaObject::Call, int, void) + 714
40 libCTKVisualizationVTKWidgets.0.1.dylib 0x000000010eede173 ctkVTKDataSetArrayComboBox::qt_metacall(QMetaObject::Call, int, void
) + 51 (moc_ctkVTKDataSetArrayComboBox.cxx:99)

nicole

nicole

2014-05-16 13:58

administrator   ~0011880

Please take a look at these changes and let me know if they make sense:

https://github.com/naucoin/Slicer/commit/068c624ac1fe1ffe0c881b006caf6bfc665f9535

nicole

nicole

2014-05-20 11:43

administrator   ~0011926

Last edited: 2014-05-20 11:45

Reminder sent to: alexy

Let me know if you think my proposed changes to the display nodes make sense.

pieper

pieper

2014-06-03 10:37

administrator   ~0012002

Alex - please review and update the bug report.

alexy

alexy

2014-06-10 06:41

developer   ~0012041

Sorry, was traveling last week. Looks good to me.

nicole

nicole

2014-06-10 11:42

administrator   ~0012046

Fix for the scalar range on the tracts checked in as svn 23324:
http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&revision=23324

I think that fixes all but the crash that I found, will make that another bug report and assign to Alex.

jcfr

jcfr

2014-09-17 23:01

administrator   ~0012530

Closing resolved issues that have not been updated in more than 3 months.

Related Changesets

Import 2017-06-07 23:51:09: master d0bffb09

2014-05-02 17:10:43

naucoin

Details Diff
BUG: fix fiber bundle color display

Check for fiber bundle display nodes and use the old method,
igoring the new scalar range options for models. Fixes bug
introduced with issue 0003573 in svn revision 23083

Issue 0003672


git-svn-id: http://svn.slicer.org/Slicer4/trunk@23118 3bd1e089-480b-0410-8dfb-8563597acbee
mod - Libs/MRML/DisplayableManager/vtkMRMLModelDisplayableManager.cxx Diff File

Import 2017-06-07 23:51:09: master 1ac16a45

2014-06-10 15:31:35

naucoin

Details Diff
BUG: calculate range of active scalar

Getting the scalar range on the poly data was returning an
incorrect tuple. Get the range of the active scalar array instead.

Issue 0003672

git-svn-id: http://svn.slicer.org/Slicer4/trunk@23324 3bd1e089-480b-0410-8dfb-8563597acbee
mod - Modules/Loadable/TractographyDisplay/MRML/vtkMRMLFiberBundleGlyphDisplayNode.cxx Diff File
mod - Modules/Loadable/TractographyDisplay/MRML/vtkMRMLFiberBundleLineDisplayNode.cxx Diff File
mod - Modules/Loadable/TractographyDisplay/MRML/vtkMRMLFiberBundleTubeDisplayNode.cxx Diff File

Issue History

Date Modified Username Field Change
2014-04-25 08:59 alexy New Issue
2014-04-25 08:59 alexy Status new => assigned
2014-04-25 08:59 alexy Assigned To => alexy
2014-04-25 09:02 alexy Target Version => Slicer 4.4.0
2014-04-26 09:33 alexy Note Added: 0011672
2014-04-29 06:50 alexy Note Added: 0011675
2014-04-29 06:53 alexy Note Added: 0011676
2014-04-29 06:53 alexy Assigned To alexy => nicole
2014-04-29 06:57 nicole Note Added: 0011677
2014-04-29 07:01 alexy File Added: 2_fiber.vtk
2014-04-29 07:05 alexy Note Added: 0011678
2014-04-29 07:05 alexy File Added: glyphs_orig.vtk
2014-05-02 07:56 nicole Note Added: 0011687
2014-05-02 07:57 nicole Note Edited: 0011687
2014-05-02 08:01 lauren Note Added: 0011688
2014-05-02 08:02 lauren Note Added: 0011689
2014-05-02 08:48 nicole Note Added: 0011691
2014-05-02 13:16 nicole Note Added: 0011692
2014-05-02 17:20 lauren Note Added: 0011693
2014-05-05 11:43 nicole Note Added: 0011694
2014-05-05 11:52 lauren Note Added: 0011695
2014-05-05 12:06 nicole Assigned To nicole => alexy
2014-05-05 12:11 nicole Note Added: 0011697
2014-05-09 08:43 alexy Note Added: 0011713
2014-05-09 11:24 alexy Note Added: 0011714
2014-05-09 12:14 alexy Note Added: 0011715
2014-05-09 12:14 alexy Assigned To alexy => nicole
2014-05-13 13:17 nicole Note Added: 0011819
2014-05-16 12:24 nicole Note Added: 0011873
2014-05-16 12:50 nicole Note Added: 0011875
2014-05-16 13:58 nicole Note Added: 0011880
2014-05-16 13:58 nicole Status assigned => feedback
2014-05-20 11:43 nicole Note Added: 0011926
2014-05-20 11:45 nicole Note Edited: 0011926
2014-06-03 10:35 nicole Status feedback => assigned
2014-06-03 10:35 nicole Assigned To nicole => alexy
2014-06-03 10:37 pieper Note Added: 0012002
2014-06-10 06:41 alexy Note Added: 0012041
2014-06-10 06:41 alexy Assigned To alexy => nicole
2014-06-10 11:42 nicole Note Added: 0012046
2014-06-10 11:42 nicole Status assigned => resolved
2014-06-10 11:42 nicole Fixed in Version => Slicer 4.4.0
2014-06-10 11:42 nicole Resolution open => fixed
2014-06-10 11:50 nicole Relationship added related to 0003734
2014-09-17 22:59 jcfr Status resolved => closed
2014-09-17 23:01 jcfr Note Added: 0012530
2015-11-30 17:50 jcfr Category Module TractographyDisplay => Module: Any Tractography modules
2016-02-29 14:04 jcfr Category Module Tractography (any modules) => Core: Diffusion & Tractography
2016-02-29 14:05 jcfr Category Core: Diffusion & Tractography => Core: Diffusion & Tractography (Any modules)
2016-06-20 14:14 jcfr Category Core: Diffusion & Tractography (Any modules) => Core: Diffusion and Tractography (Any modules)
2017-06-10 08:51 Changeset attached => Slicer master 1ac16a45
2017-06-10 08:51 Changeset attached => Slicer master d0bffb09