Ticket #4522 (closed: fixed)
MD Slice viewer should display Dimension name, not dim ID
Reported by: | Alex Buts | Owned by: | Janik Zikovsky |
---|---|---|---|
Priority: | critical | Milestone: | Release 2.0 |
Component: | VATES | Keywords: | |
Cc: | zikovskyjl@… | Blocked By: | |
Blocking: | #4557 | Tester: | Alex Buts |
Description
The slice viewer works with multiple Hisot Dimensions. Such dimensions have dimensionID and dimentionName as its properties.
The dimensionID should be used to select the dimension and dimensionName written along the axis of the graph.
As it is done now, the dimension ID is used both for identifying the axis and as caption along the axis.
It is dimensionName which should be written along the axis in a slice-viewer.
Change History
comment:1 Changed 9 years ago by Nick Draper
- Owner set to Janik Zikovsky
- Status changed from new to assigned
comment:2 Changed 9 years ago by Janik Zikovsky
Do we have a document defining what dimension ID should be? So far I have assumed that Dimension ID = dimension name.
comment:3 Changed 9 years ago by Alex Buts
I started this work and did some modifications to dimension name writing function of MDWSDescription class but this work is not completed yet as we can not agree with Andrei on dimensions.
Despite that, the axis name is already different (may be wrong) for MD workspace produced by "ConertToMDEvents" algorithm. May be used for verification.
e.g. dimension ID is Q1, Q2 but if u=[1,1,0] and v=[-1,1,0] dimension names should be [Qh,Qk,0],[-Qh,Qk,0]
comment:4 Changed 9 years ago by Nick Draper
- Priority changed from major to critical
- Milestone changed from Iteration 33 to Iteration 32
Janik, this is quite urgent and should ideally get into the iteration 32 release.
If you are not clear on the problem, or think that this will take more than a couple of days let me know.
comment:7 Changed 9 years ago by Janik Zikovsky
- Status changed from accepted to verify
- Resolution set to invalid
See SliceViewer.cpp line 846:
m_plot->setAxisTitle( axis, QString::fromStdString(dim->getName() + " (" + dim->getUnits() + ")") );
As you can see, the name is displayed, not the ID. I suspect that the dimension was set incorrectly (name got the ID and ID got the name)?
comment:8 Changed 9 years ago by Alex Buts
for (size_t d=0; d<nd; d++) {
Geometry::MDHistoDimension * dim = new Geometry::MDHistoDimension(this->targ_dim_names[d], this->targ_dim_ID[d],this->targ_dim_units[d],this->dim_min[d], this->dim_max[d], 10);
ws->addDimension(Geometry::MDHistoDimension_sptr(dim));
}
This is what I have in the code for names. And if ID and Name are just swapped, SliceView should not pick up slice by ID. Do not know
comment:9 Changed 9 years ago by Janik Zikovsky
Could it be this?
ConvertToMDEvents line 655:
// set up the target workspace description; TargWSDescription.n_dims = nDims; TargWSDescription.emode = emode; TargWSDescription.dim_names = dim_IDs_requested; TargWSDescription.dim_IDs = dim_IDs_requested; TargWSDescription.dim_units = dim_units_requested;
comment:10 Changed 9 years ago by Alex Buts
refs #4522 This actually fixes it
This actually fixes problem with axis caption in sliceViever The problem was in convert to MD, SliceViever itself is fine.
Changeset: ab9308cca7d939767dd8d9af836934e81ce286c2
comment:11 Changed 9 years ago by Janik Zikovsky
- Status changed from verify to reopened
- Resolution invalid deleted
comment:13 Changed 9 years ago by Janik Zikovsky
- Status changed from accepted to verify
- Resolution set to fixed
Fixed by Alex above.
comment:14 Changed 9 years ago by Alex Buts
- Status changed from verify to verifying
- Tester set to Alex Buts
comment:15 Changed 9 years ago by Alex Buts
- Status changed from verifying to closed
The error was in convertToMD, not in SliceViewer itself
Now it happily writes axis names requested
comment:16 Changed 5 years ago by Stuart Campbell
This ticket has been transferred to github issue 5369