View Issue Details

IDProjectCategoryView StatusLast Update
0003502Slicer4Module Markupspublic2018-03-02 11:02
ReporterLchauvin Assigned Tonicole  
PrioritynormalSeverityfeatureReproducibilityN/A
Status closedResolutionfixed 
Product Version 
Target VersionFixed in VersionSlicer 4.7.0 
Summary0003502: Get Markups with ID
Description

It would be great to be able to get Markups with their ID.
I implemented it, I will submit it to Nicole's review.

TagsNo tags attached.

Activities

nicole

nicole

2013-11-19 08:52

administrator   ~0010338

https://github.com/Slicer/Slicer/pull/83/files

Please add a test.
A linear search could get slow when looking for a markup near the end of the list. The ids are generally numbered by index, could you add in a "base case" that determines an index from the ID number and checks at that index and maybe +/-1 around it for the matching id?

Lchauvin

Lchauvin

2013-11-19 09:00

developer   ~0010339

Is there any mechanism for organizing Markups ? (Like move up, move down).
Because if there is such mechanism, that means maybe a markup with and ID of 22 could be in index 5 if it has been moved.

nicole

nicole

2013-11-19 09:18

administrator   ~0010340

Yes, Markups can be moved down/up or removed and that will shift things, but a quick check at the ID index will generally succeed.

Lchauvin

Lchauvin

2013-11-19 09:20

developer   ~0010341

Should I do a double check ?
Check if +/- 1 around the index in the markup ID is the right one, if not found, do a check of all markups in the list until finding it (or not) ?

nicole

nicole

2013-11-19 09:27

administrator   ~0010342

yes, that's what I was suggesting.

Lchauvin

Lchauvin

2013-11-19 10:24

developer   ~0010343

Ok, I can implement that.
However, I'm not sure what to do for the test.

nicole

nicole

2013-11-19 10:47

administrator   ~0010344

Thinking more about it, +/-1 around the id index can be skipped, that might be too much code for the cases where only 1 fid was removed or moved.

Add a few calls to the vtkMRMLMarkupsNodeTest2.cxx file to check that the index and id match up (also add tests for null and unmoved/deleted markups in a list).

Lchauvin

Lchauvin

2013-11-19 13:26

developer   ~0010346

Is this test enough ?
https://github.com/lchauvin/Slicer/commit/120bf1dc95790245b70f6a0142ee90db0ae25d62

nicole

nicole

2013-11-20 07:22

administrator   ~0010353

The test is a good start, I'd also add testing the failure cases (trying to get a markup with an id that doesn't exist in the list, trying with a null ID).

After looking at the code, you don't need to add the test around the index in the ID, it won't be very helpful.

lassoan

lassoan

2017-06-15 11:09

developer   ~0014859

vtkMRMLMarkupsNode::GetMarkupIndexByID() method is now available that implements this functionality(http://apidocs.slicer.org/master/classvtkMRMLMarkupsNode.html#a29ef78f692c11028e869be840791afc1)

Issue History

Date Modified Username Field Change
2013-11-19 06:51 Lchauvin New Issue
2013-11-19 06:51 Lchauvin Status new => assigned
2013-11-19 06:51 Lchauvin Assigned To => nicole
2013-11-19 08:52 nicole Note Added: 0010338
2013-11-19 09:00 Lchauvin Note Added: 0010339
2013-11-19 09:18 nicole Note Added: 0010340
2013-11-19 09:20 Lchauvin Note Added: 0010341
2013-11-19 09:27 nicole Note Added: 0010342
2013-11-19 10:24 Lchauvin Note Added: 0010343
2013-11-19 10:47 nicole Note Added: 0010344
2013-11-19 13:26 Lchauvin Note Added: 0010346
2013-11-20 07:22 nicole Note Added: 0010353
2017-06-15 11:09 lassoan Status assigned => resolved
2017-06-15 11:09 lassoan Resolution open => fixed
2017-06-15 11:09 lassoan Note Added: 0014859
2017-06-15 11:10 jcfr Fixed in Version => Slicer 4.7.0
2018-03-02 11:02 jcfr Status resolved => closed