Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: ENH: Relative dose representation for isolevels #168

Merged
merged 1 commit into from
Nov 25, 2020

Conversation

MichaelColonel
Copy link
Collaborator

Here is my understanding of relative dose isolevels, possible solution for #36, #96.

If RTDOSE type is "GY" then clicking on "Percentage dose isolevels" check box you can switch between absolute and relative isolevels representation. If RTDOSE type is "RELATIVE" then only relative representation is available.

Screenshot as an example:
image

Copy link
Member

@cpinter cpinter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot, makes sense to me.

In addition to my comments in the code I find it strange that you have a collpasible button on the UI for the Prescribed or reference dose, but then below you have the levels table. It is quite confusing what belongs where.

@@ -37,6 +37,7 @@ class vtkMRMLColorTableNode;
class VTK_SLICER_ISODOSE_LOGIC_EXPORT vtkMRMLIsodoseNode : public vtkMRMLNode
{
public:
enum DoseUnitsType { GY, RELATIVE, UNKNOWN_UNITS };
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please see how enums are usually set up in Slicer and follow that convention

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In addition to my comments in the code I find it strange that you have a collpasible button on the UI for the Prescribed or reference dose, but then below you have the levels table. It is quite confusing what belongs where.

Not quite sure what is the problem with levels table? Do you want to get rid of it entirely?

Dose units will be used as follows: enum DoseUnitsType { Unknown = -1, Gy = 0, Relative = 1 };

protected:
vtkMRMLIsodoseNode();
~vtkMRMLIsodoseNode();
vtkMRMLIsodoseNode(const vtkMRMLIsodoseNode&);
void operator=(const vtkMRMLIsodoseNode&);

void SetDoseUnits(int doseUnits = 0);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's strange that there is a default value for the argument in a Set function. Why?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no default value anymore.

@@ -217,7 +216,7 @@ void qSlicerIsodoseModuleWidget::setMRMLScene(vtkMRMLScene* scene)
}
else
{
vtkSmartPointer<vtkMRMLIsodoseNode> newNode = vtkSmartPointer<vtkMRMLIsodoseNode>::New();
vtkNew<vtkMRMLIsodoseNode> newNode;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for cleaning up the code as you go.

image->GetScalarRange(valueRange);
if (!doseUnitName.compare("RELATIVE"))
{
paramNode->SetDoseUnits(vtkMRMLIsodoseNode::RELATIVE);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is how you should namespace an enum (the class name instead of the enum type). Please fix the wrong ones.

scalarBarTitle += " (" + doseUnitName + ")";
case vtkMRMLIsodoseNode::DoseUnitsType::GY:
{
const char* str = relativeRepresentation ? " (%)" : " (Gy)";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrong indentation. Please fix here and below

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

relativeFlag = true;
}
std::string isodoseName = (relativeFlag) ?
vtkSlicerIsodoseModuleLogic::ISODOSE_RELATIVE_ROOT_HIERARCHY_NAME_POSTFIX :
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need to have two different postfixes? Can we use both at the same time?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two isolevels at the same time don't work quite right in hierarchy node. If both absolute and relative isolevels with the same postfix in hierarchy you can hide only one isolevel folder node, other can't be hidden. So if use only one postfix => only one isolevels folder node.

@cpinter
Copy link
Member

cpinter commented Nov 18, 2020

Not quite sure what is the problem with levels table? Do you want to get rid of it entirely?

No, obviously not. But from your screenshot it seems that you have a new collapsible button within the Input section. The problem with that button is that it's not obvious where that section ends, and that it is unusual to have a collapsible button within another collapsible button. I suggest reorganizing the UI so that it is less confusing. Maybe instead of a collapsible button, you could put the "Prescribed or reference dose value" in a groupbox, but other solutions could work too.

@MichaelColonel
Copy link
Collaborator Author

Maybe instead of a collapsible button, you could put the "Prescribed or reference dose value" in a groupbox, but other solutions could work too.

I've changed UI a little with some other fixes.

image

@cpinter
Copy link
Member

cpinter commented Nov 20, 2020

I like this much better, thank you!

@lassoan @gregsharp do you have anything to add? If not then I'll merge this on or after the weekend.

@cpinter cpinter merged commit 6544cc9 into SlicerRt:master Nov 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants