Difference between revisions of "User talk:Lchauvin"

From NAMIC Wiki
Jump to: navigation, search
(Blanked the page)
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
==Projects==
 
----
 
  
*[[OsteoPlan]]
 
*[[SlicerOnAMIGO]]
 
*[[4D Ultrasound]]
 
*[[NeuroNav]]
 
 
 
*[[Biopsy Module]]
 
*[[LineMotion Extension]]
 
 
== Progress reports ==
 
----
 
===Brainlab / Slicer integration in AMIGO===
 
* BUG: Brainlab system turn off by himself randomly (maybe due to run software on VM)
 
* DONE: Update OpenIGTLink version (Laptop)
 
** TODO: Submit modification on trunk (Junichi)
 
 
===Hybrid Probe===
 
* Aurora configuration (from IGSTK):
 
 
  communication->SetBaudRate(SerialCommunication::BaudRate9600);                  // Baud: 9600
 
  communication->SetDataBits(SerialCommunication::DataBits8);                      // DataBits: 8
 
  communication->SetParity(SerialCommunication::NoParity);                        // Parity: 0
 
  communication->SetStopBits(SerialCommunication::StopBits1);                      // StopBits: 1
 
  communication->SetHardwareHandshake(SerialCommunication::HandshakeOff);          // HandShake: 0
 
 
*TODO: Try NDI Toolkit with Brainlab system
 
 
===4D Ultrasound===
 
* DONE: Tried to use Timer to be able to run client without freezing slicer when sending data
 
** This solution is not efficient enough, because the system is really slow down
 
** Try thread
 
* DONE: Send JB. data to slicer and use volume rendering
 
* DONE: Convert Jim Barabas data with matlab (cf. /projects/igtdev/lchauvin/Slicer3-Datasets/complete_data.m)
 
* INFO: OpenIGTLink Informations
 
** svsize = size of the full volume (or picture)
 
** spacing = size of the voxels
 
** svsize = size of the sub-volume (a part of the volume)
 
** svoffset = position of the center of the voxel (0,0,0)
 
*** TRICK: Offset in nrrd file indicate offset to the corner of the voxel. In OpenIGTLink, it represents the center of the voxel.
 
*** To calculate the offset to set on OpenIGTLink, use this equation:
 
**** '''OpenIGTLink_Offset = Corner_Offset ± (number_of_voxels * spacing)/2 - spacing/2 '''
 
***** ± sign depends on the orientation of the coordinate system compared to RAS (example for LPS: - for L, - for P, + for S)
 
* INFO: Convert gzip to raw using this command
 
**'''unu data vol.nrrd | gunzip > vol.raw'''
 
* <span style="color:green;">IN PROGRESS:</span> Create GUI for Slicer
 
** DONE: Interface to select nrrd directory
 
** TODO: Create and implement "Parse files" button
 
* INFO: Could use vtkZlibDataCompressor to decompress data in nrrd files
 
** Need to know uncompressed data memory space needed before calling uncompress function
 
* INFO: Could try to use vtkNRRDReader (in Slicer3/Libs/vtkTeem)
 
* INFO: Use this process to send file through OpenIGTLink
 
    //------------------------------------------------------------
 
    // size parameters
 
    int  size[]    = {130, 256, 256};      // image dimension
 
    float spacing[]  = {-1.3, 1.0, -1.0};    // spacing (mm/pixel)
 
    int  svsize[]  = {130, 256, 256};      // sub-volume size
 
    int  svoffset[] = {0,0,0};          // sub-volume offset
 
    int  scalarType = igtl::ImageMessage::TYPE_INT8;// scalar type
 
    //------------------------------------------------------------
 
    // Create a new IMAGE type message
 
    igtl::ImageMessage::Pointer imgMsg = igtl::ImageMessage::New();
 
    imgMsg->SetDimensions(size);
 
    imgMsg->SetSpacing(spacing);
 
    imgMsg->SetScalarType(scalarType);
 
    imgMsg->SetDeviceName("ImagerClient");
 
    imgMsg->SetSubVolume(svsize, svoffset);
 
    imgMsg->AllocateScalars();
 
 
Then, add Data to imgMsg using Scalar pointer (GetScalarPointer). But these data should be decompressed before (gzip). Then send Image packet.
 
* ISSUE: How to send a set of file (not just one file) with OpenIGTLink
 
* INFO: nrrd files are compressed with gzip
 
** Need an nrrd reader
 
*** ITK provide one
 
*** Teem use unu (command line) to convert nrrd file (not really useful for now)
 
* PLANNED: Meeting with Junichi on March, 4th
 
** TOPIC: Send Image with OpenIGTLink and use timestamps
 
**SUMMARY
 
***Junichi explained me how image were send with OpenIGTLink
 
***He shew me example ImagerClient
 
* DONE: Create and upload dataset
 
** [[File:4DUltrasound-part1.tar.bz2]]
 
** [[File:4DUltrasound-part2.tar.bz2]]
 
** Backup on Google Docs
 
 
===Biopsy Module===
 
* <span style="color:green;">IN PROGRESS:</span> Snap fiducial to model
 
** Need a representation to apply vtkPolygonalSurfacePointPlacer
 
*** Don't have with vtkSourceLine, tried to use vtkLineWidget2. Don't have GetRepresentation() method anymore.
 
** Check AbdoNav Module (Measurement tool)
 
* DONE: Update line and planes when moving fiducials
 
** Slowing down the system (maybe could be improved)
 
* INFO: Snapping point seems to come from vtkPolygonalSurfacePointPlacer class (find from vtkMeasurementsRulerWidget (L1348, L1447) -> vtkMeasurementsDistanceWidgetClass)
 
** Need to set as input (with AddProp) properties of the model (vtkProp)
 
* <strike>BUG: When slider is smaller than line's length, both sliders are moved</strike>
 
** FIXED: Add test to watch witch one reach limit, and update range
 
* DONE: Use new planes to reslice
 
** ISSUE: Render and reslice are two different things, render is called when reslicing (don't call it again)
 
*** SOLUTION: Add a checkbox
 
**** Not rendering twice, but render is not call anymore if not reslicing (need to put mouse on 3D Render to update)
 
* DONE: Create 3 planes (instead of one): Perpendicular, In-Plane 0 and In-Plane 90
 
* DONE: Posibility to create and use different fiducial list to draw line
 
* DONE: Add toggle checkbox to turn on/off plane visibility
 
* DONE: Translate plane along the axis
 
* DONE: Create plane along the line
 
** MODIFIED: Plane is now perpendicular to the line
 
* DONE: Use two sliders to extend line
 
** Line could be extended and retracted, but the distance between fiducials define minimal distance of the line allowed
 
* DONE: Create line between two fiducials
 
 
===OsteoPlan===
 
** Use vtkLoopSubdivisionFilter to reduce polygons size before clipping (longer but efficient)
 
** To come back to original position with fiducials
 
*** Look at parent transformation node if existing (GetParentTransformNode() )
 
*** If yes, get matrix 4x4 (GetMatrixTransformToParent())
 
*** make a copy, and set the original one to Identity
 
*** Invert copied matrix
 
*** Set it under original transform node (SetAndObserveTransformNodeID(transformNodeID) and call InvokeEvent(vtkMRMLScene::SceneEditedEvent) )
 
*** Move fiducial list under inverted matrix (SetAndObserveTransformNodeID(transformNodeID)  and call InvokeEvent(vtkMRMLScene::SceneEditedEvent) )
 
*** Apply Identity matrix to top node
 
* '''DONE: Place markers on models where the screws will be (Second Milestone Reached)'''
 
** Use Fiducials synchronized with models (vtkCollection)
 
* '''DONE: Be able to separate different regions by clicking on them (First Milestone Reached)'''
 
** Use the same method as on OsteoPlan.tcl
 
** Create model from these regions instead of using actors
 
* DONE: Fix memory leaks on clipping function in Logic
 
** Delete cleanPoly at the end
 
* DONE: Study OsteoPlan.tcl obtained from Hua Li (MGH)
 
**METHOD USED
 
***Clipping model (with vtkPolyBoolean, not existing anymore, but could probably be replaced by vtkImplicitBoolean and vtkClippingPolyData)
 
***Use vtkCellPicker to pick a cell of first part of the model
 
***Use vtkPolyDataConnectivityFilter with Seeding option (seed used is the cell picked with vtkCellPicker)
 
***Create a model with the output of connectivity filter
 
***Do the same for the second part of the model
 
* MEETING: Send an email to Hua Lee (MGH) to set up a meeting
 
** DONE: Meeting on Friday, 4th. 3pm. 25 New Chardon Street, 4th Floor.
 
** TOPICS: See a demonstration of OsteoPlan, get source code, ask questions about user interface
 
** SUMMARY
 
***Possibility to cut a model with a plan on version 2.1
 
***Got the source code
 
***Explain what we already have on Slicer 3.6
 
***User documentation of OsteoPlan on 2.1 received
 
***Get models used
 
* <strike>BUG: Issue with vtk when trying to reinitialize array PointMap</strike>
 
** A message has been sent to vtk mailing list
 
*** See bug section (problem coming from TraverseAndMark() )
 
**** Don't need to use this way now
 
* DONE: Fixed issue that didn't allow to show/hide model from polydata
 
** FIX: Use this piece of code to create a MRMLModelNode from polydata:
 
 
 
  // Create new polydata
 
  vtkPolyData* polyDataModel1 = vtkPolyData::New();
 
  //
 
  // Create New vtkMRMLNode
 
  this->part1 = vtkMRMLModelNode::New();
 
  //
 
  // Create New vtkMRMLModelDisplayNode
 
  vtkMRMLModelDisplayNode* dnode1 = vtkMRMLModelDisplayNode::New();
 
  //
 
  // Add them to the scene
 
  this->part1->SetScene(this->GetMRMLScene());
 
  dnode1->SetScene(this->GetMRMLScene());
 
  //
 
  this->GetMRMLScene()->AddNode(dnode1);
 
  this->GetMRMLScene()->AddNode(part1);
 
  //
 
  // Use new polydata model to be "ready" to receive data
 
  part1->SetAndObservePolyData(polyDataModel1);
 
  part1->SetAndObserveDisplayNodeID(dnode1->GetID());
 
  //
 
  // Copy polydata to the new polydata model
 
  dnode1->SetPolyData(clipper->GetOutput());
 
  //
 
  // Clean
 
  polyDataModel1->Delete();
 
 
* DONE: Enable to resize cutter and keep same position
 
* DONE: Study the OsteoPlan.tcl from Slicer2
 
**VTK class vtkPolyBoolean does not exist anymore
 
**Need to compare this version of OsteoPlan.tcl to OsteoPlan.tcl obtained from Hua Li (MGH).
 
* DONE: Clipped part inside the box, and use vtkPolyDataConnectivityFilter to extract largest and second largest region
 
** Could be good with SpecifiedRegion if the model was not empty (too many regions else)
 
*** Is there a way to fill a surface in slicer ?
 
** Use Largest region
 
*** Need a new function on this classs to get "second largest region"
 
**** Largest region use a sorted array -> Need to find second largest region and return it
 
***** Second largest region seems not to be the "piece" I needed
 
* FAILED: Try to use boudingbox and perform one first positive clipping, and a second negative clipping on the output of the first one.
 
** Not possible because of the output of the clipping. Return inside of the box as a model and outside (everything outside, which mean top and bottom part) as another
 
* DONE: Installed VTK 5.7, and tried vtkClipClosedSurface
 
** Good function, but use infinite plane
 
* FAILED: Tried to use kind of boolean operation (vtkExtractPolyDataGeometry, with filters, etc...)
 
** Took 15 minutes to perform clipping, with infinite plane, and with model bugs
 
** Do not use this way
 
* DONE: Clipping with big boundingbox
 
** Working, fast, but not really a cutter
 
** A cap is missing on the clipped part
 
 
===LineMotion Extension===
 
* '''Extension Completed'''
 
* DONE: Use color for different lines
 
* DONE: Keep index of fiducial list and actor synchronized when deleting a fiducial list
 
* DONE: Display multiple lines
 
* DONE: Posibility to create and use different fiducial list to draw line
 
* DONE: Add toggle checkbox to turn on/off plane visibility
 
* DONE: Translate plane along the axis
 
* DONE: Create plane along the line
 
** MODIFIED: Plane is now perpendicular to the line
 
* DONE: Use two sliders to extend line
 
** Line could be extended and retracted, but the distance between fiducials define minimal distance of the line allowed
 
* DONE: Create line between two fiducials
 
 
==Todo, Bug, Ideas, ...==
 
----
 
* <u>4D Ultrasound</u>
 
** <strike>TODO: Have a look at unu (from teem library) to convert nrrd files</strike>
 
*** Cf Ultrasound section(unu data)
 
** TODO: Have a look at ITK NRRD Reader (cf. Andriy source code (email))
 
** <strike>TODO: Have a look at vtkNRRDReader</strike>
 
***Study ITK NRRD Reader
 
***[http://www.vtk.org/Wiki/Getting_Started_with_the_NRRD_Format Getting Started with the NRRD Format]
 
** <strike>TODO: Contact Jim Barabas to get US Data (barabas@mit.edu)</strike>
 
*** DONE: Data are not in nrrd format as expected
 
*** DONE: Data converted and sent to slicer
 
 
* <u>Biopsy Module</u>
 
** TODO: Snap a fiducial (entry point) to the model
 
*** Ask Nicole Aucoin and the Measurement module
 
 
* <u>Transform Module</u>
 
**ISSUE: Report Transform Module Issue (vtkKWMatrix4x4 observing Matrix4x4 and not vtkMRMLLinearTransformNode, if using ApplyTransform, new node is created and pointer is broken, then Transform Module is not updating anymore)
 
 
* <u>LineMotion Extension</u>
 
**<strike>BUG: Leaks when clicking several times on "Draw line" button</strike>
 
***FIXED: Move all "New()" method in constructor instead of event of "draw line" button, and add some verification before using this objects
 
**<strike>TODO: Find a better way to link Fiducial list and Actor list</strike>
 
***Synchronize 2 vtkCollections seems not possible -> Need to keep index "synchronized" manually
 
****Remove actor when fiducial list deleted to keep the index "synchronized"
 
 
* <u>OsteoPlan Module</u>
 
**<strike>IDEA: Use vtkImplicitModeller with vtkBoxWidget2 and a clipping function (propably vtkClipPolyData)</strike>
 
***FAILED: vtkImplicitModeller compute distance with geometry. Not what I'm looking for.
 
** <strike>ISSUE: VTK pointer of the PointMap array seems to be modified after TraverseAndMark function, creating a crash</strike>
 
*** Tried to comment TraverseAndMark in extractLargestRegion. Worked but dirty and ExtractLargestRegion didn't work anymore.
 
****Anyway, secondLargestRegion return nothing.
 
***** Don't need anymore. Shoud be reported to vtk.
 
** BUG: Issue with multiple clipping (clipping seems not to work properly, leaks when leaving)
 
*** TODO: Check if problem solved after deleting cleanPoly
 
**** Not fixing
 
*** Seems to use the original model when clipping the second time (but create a model clipped twice)
 
*** Clipping function is modifying original model ?
 
** ISSUE: Not able to load a scene
 
*** Probably because pointer of Interactor (or Window) change when loading a scene
 
*** Need to use Import scene instead for now
 
** BUG: Problem with clipping function when cutter is too thin
 
*** TODO: Maybe apply clipping twice
 
*** Problem because triangles of models are bigger than thickness of the cutter
 
**** Tried to subdivide this triangles, better but not working completely, and takes time.
 
** <strike>BUG: Segmentation Fault when clicking in empty region when selecting parts</strike>
 
*** FIXED: Verify a cell is picked before calling Connectivity Filter
 

Latest revision as of 22:46, 5 January 2012

Home < User talk:Lchauvin