Difference between revisions of "Documentation/4.10/Modules/SampleData"

From Slicer Wiki
Jump to: navigation, search
(Nightly -> 4.10)
 
Line 52: Line 52:
 
This module is written in python, and relies on MRML's ability to access datasets via the http protocol.
 
This module is written in python, and relies on MRML's ability to access datasets via the http protocol.
  
The sample data is accessed from the wiki at this url: http://www.slicer.org/slicerWiki/index.php/SampleData
+
Historically, the sample data have been accessed from the wiki at this url: http://www.slicer.org/slicerWiki/index.php/SampleData
  
 +
Modules can register their own sample data using <t>registerCustomSampleDataSource()</t>. Code like the following can be added to module class constructor:
 +
 +
<pre>
 +
    iconsPath = os.path.join(os.path.dirname(self.parent.path), 'Resources/Icons')
 +
    import SampleData
 +
 +
    SampleData.SampleDataLogic.registerCustomSampleDataSource(
 +
      category='Sequences',
 +
      sampleName='CTPCardio',
 +
      uris='http://slicer.kitware.com/midas3/download/bitstream/667462/CTP-cardio.seq.nrrd',
 +
      fileNames='CTP-cardio.seq.nrrd',
 +
      nodeNames='CTPCardio',
 +
      thumbnailFileName=os.path.join(iconsPath, 'CTPCardio.png'),
 +
      loadFileType='Volume Sequence'
 +
)
 +
</pre>
 +
 +
 +
To register sample data available only when developer mode is enabled, set category using <tt>SampleData.SampleDataLogic().developmentCategoryName</tt>
  
Modules can register their own sample data by following [https://github.com/Slicer/Slicer/blob/master-43/Modules/Scripted/SampleData/SampleData.py#L163-182 the example in the module].
 
  
  

Revision as of 14:00, 14 March 2019

Home < Documentation < 4.10 < Modules < SampleData


For the latest Slicer documentation, visit the read-the-docs.


Introduction and Acknowledgements

Author(s)/Contributor(s): Steve Pieper (Isomics Inc.), Jean-Christophe Fillion-Robin (Kitware), Julien Finet (Kitware), Benjamin Long (Kitware)
Acknowledgements: This work is part of the National Alliance for Medical Image Computing (NA-MIC), funded by the National Institutes of Health through the NIH Roadmap for Medical Research, Grant U54 EB005149.
Contact: Steve Pieper, <email>pieper@bwh.harvard.edu</email>
Isomics, Inc.  
Kitware, Inc.  
National Alliance for Medical Image Computing (NA-MIC)  

Module Description

Provides an easy to download a variety of anonymized datasets (Mr, CT, ...) for learning and testing in Slicer. Because the datasets are hosted in a remote repository, a network connection is required to access them. Sample Data Module

Use Cases

Examples:

  • Use Case 1: Download an MR Volume to experimenting with the EMSegmenter.
  • Use Case 2: Download a CT Volume for use with the Volume Rendering Module.
  • Use Case 3: Download a DTI Volume for use with Tractography.

Tutorials

Panels and their use

This interface consists of a series of buttons for various download volumes. Status about downloads is displayed below the buttons.

Similar Modules

  • The DICOM module can be used to access sample data on DICOM servers.

References

N/A

Information for Developers

This module is written in python, and relies on MRML's ability to access datasets via the http protocol.

Historically, the sample data have been accessed from the wiki at this url: http://www.slicer.org/slicerWiki/index.php/SampleData

Modules can register their own sample data using <t>registerCustomSampleDataSource()</t>. Code like the following can be added to module class constructor:

    iconsPath = os.path.join(os.path.dirname(self.parent.path), 'Resources/Icons')
    import SampleData

    SampleData.SampleDataLogic.registerCustomSampleDataSource(
      category='Sequences',
      sampleName='CTPCardio',
      uris='http://slicer.kitware.com/midas3/download/bitstream/667462/CTP-cardio.seq.nrrd',
      fileNames='CTP-cardio.seq.nrrd',
      nodeNames='CTPCardio',
      thumbnailFileName=os.path.join(iconsPath, 'CTPCardio.png'),
      loadFileType='Volume Sequence'
)


To register sample data available only when developer mode is enabled, set category using SampleData.SampleDataLogic().developmentCategoryName