# Is dataStore upload working?

**URL:** <https://discourse.slicer.org/t/is-datastore-upload-working/5071>\
**Category:** Support\
**Created:** [December 13, 2018, 5:54pm UTC](https://discourse.slicer.org/t/is-datastore-upload-working/5071 "2018-12-13T17:54:21Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)\
**Post date:** [December 13, 2018, 5:54pm UTC](https://discourse.slicer.org/t/is-datastore-upload-working/5071/1 "2018-12-13T17:54:21Z")

</div>

I am trying to upload a scene to DataStore. It has a two volumes (one grayscale, one labelmap) and a markups list. I created an account, logged in, described the contents etc. Now the upload is hung, doesn’t seem to progress et all. When saved to disk, MRB file itself is only 11MB. Is that a connection issue (I am behind a proxy)?

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [December 13, 2018, 11:20pm UTC](https://discourse.slicer.org/t/is-datastore-upload-working/5071/2 "2018-12-13T23:20:44Z")

</div>

Are you trying to use the upload feature in Slicer or just the Midas web interface in a web browser?

Midas is being replaced by Girder and maybe some features have been disabled already.

---

<div class="post-metadata">

**Author:** ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)\
**Post date:** [December 14, 2018, 1:12am UTC](https://discourse.slicer.org/t/is-datastore-upload-working/5071/3 "2018-12-14T01:12:14Z")

</div>

@lassoan  
No, I am using the built-in upload option. See the screenshot.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/3/5/35df43cb13fca42f8ca154fa5f79f6fb4b21d433.png)

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [December 14, 2018, 3:07am UTC](https://discourse.slicer.org/t/is-datastore-upload-working/5071/4 "2018-12-14T03:07:43Z")

</div>

You can try uploading scenes by using the web interface in a browser. What data would you like to upload and for what audience and purpose?

When the DataStore module was developed it was hard to find reliable and easily affordable hosting service for research data. However, there are lots of possibilities now (GitHub, Zenodo, low-cost unlimited hosting services, etc.), so DataStore may be reduced to a data index that can point to data stored at various places - similarly how the Extension Manager or Sample Data module work.

You can probably find good free hosting service and you can add links and images to SampleData (as it is done for example in [SequenceSampleData module](https://github.com/SlicerRt/Sequences/tree/master/SequenceSampleData) in Sequences extension).

---

<div class="post-metadata">

**Author:** ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)\
**Post date:** [December 14, 2018, 3:46am UTC](https://discourse.slicer.org/t/is-datastore-upload-working/5071/5 "2018-12-14T03:46:54Z")

</div>

I don’t need hosting, just a to convenient way to pull existing data into Slicer. This looks it is going to work a like champ. Thanks Andras.

---

<div class="post-metadata">

**Author:** ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)\
**Post date:** [December 14, 2018, 5:23am UTC](https://discourse.slicer.org/t/is-datastore-upload-working/5071/6 "2018-12-14T05:23:48Z")

</div>

Actually one more question: I modified the example script with my url. Data downloads correctly, but fails to get loaded into Slicer. I can open the cached version manually, it is not corrupted or anything. All I changed are these lines:

> sampleName=‘Mouse Head microCT Atlas’,  
> uris=‘[https://github.com/muratmaga/mouse\_CT\_atlas/blob/3da1c36c057537384376155f347d08b34817fa5c/data/templates/35\_mic\_23strain\_mus\_template\_UCHAR.nii.gz?raw=true](https://github.com/muratmaga/mouse_CT_atlas/blob/3da1c36c057537384376155f347d08b34817fa5c/data/templates/35_mic_23strain_mus_template_UCHAR.nii.gz?raw=true)’,  
> fileNames=‘35\_mic\_23strain\_mus\_template\_UCHAR.nii.gz’,  
> nodeNames=‘Mus’,

\<b\>Requesting download\</b\> \<i\>35\_mic\_23strain\_mus\_template\_UCHAR.nii.gz\</i\> from [https://github.com/muratmaga/mouse\_CT\_atlas/blob/3da1c36c057537384376155f347d08b34817fa5c/data/templates/35\_mic\_23strain\_mus\_template\_UCHAR.nii.gz?raw=true](https://github.com/muratmaga/mouse_CT_atlas/blob/3da1c36c057537384376155f347d08b34817fa5c/data/templates/35_mic_23strain_mus_template_UCHAR.nii.gz?raw=true)…

\<i\>Downloaded 960.0 KB (10% of 9.3 MB)…\</i\>

\<i\>Downloaded 1.9 MB (20% of 9.3 MB)…\</i\>

\<i\>Downloaded 2.8 MB (30% of 9.3 MB)…\</i\>

\<i\>Downloaded 3.7 MB (40% of 9.3 MB)…\</i\>

\<i\>Downloaded 4.7 MB (50% of 9.3 MB)…\</i\>

\<i\>Downloaded 5.6 MB (60% of 9.3 MB)…\</i\>

\<i\>Downloaded 6.5 MB (70% of 9.3 MB)…\</i\>

\<i\>Downloaded 7.5 MB (80% of 9.3 MB)…\</i\>

\<i\>Downloaded 8.4 MB (90% of 9.3 MB)…\</i\>

\<i\>Downloaded 9.3 MB (100% of 9.3 MB)…\</i\>

\<b\>Download finished\</b\>

\<b\>Requesting load\</b\> \<i\>35micron\_Mouse\_Atlas\</i\> from C:/Users/Murat/AppData/Local/Temp/Slicer/RemoteIO/35\_mic\_23strain\_mus\_template\_UCHAR.nii.gz…

\<font color="red"\>\<b\> Load failed!\</b\>\</font\>

---

<div class="post-metadata">

**Author:** ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)\
**Post date:** [December 14, 2018, 6:54pm UTC](https://discourse.slicer.org/t/is-datastore-upload-working/5071/7 "2018-12-14T18:54:39Z")

</div>

@muratmaga here’s a working sample for that data.

```auto
import SampleData

dataSource = SampleData.SampleDataSource(
  sampleName= 'Mouse Head microCT Atlas', 
  uris= 'https://github.com/muratmaga/mouse_CT_atlas/blob/3da1c36c057537384376155f347d08b34817fa5c/data/templates/35_mic_23strain_mus_template_UCHAR.nii.gz?raw=true',
  fileNames= '35_mic_23strain_mus_template_UCHAR.nii.gz', 
  nodeNames= 'Mus'
  )

SampleData.SampleDataLogic().downloadFromSource(dataSource)

```

---

<div class="post-metadata">

**Author:** ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)\
**Post date:** [December 14, 2018, 7:03pm UTC](https://discourse.slicer.org/t/is-datastore-upload-working/5071/8 "2018-12-14T19:03:53Z")

</div>

Thanks Steve, it works if I copy/paste to the python console.

But I actually want to add a new Category to the SampleData module as the Sequences module have done. I have been trying to modify the following to make it work with this particular data (as well as few other different kinds).

> <https://github.com/SlicerRt/Sequences/blob/master/SequenceSampleData/SequenceSampleData.py>

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [December 14, 2018, 7:21pm UTC](https://discourse.slicer.org/t/is-datastore-upload-working/5071/9 "2018-12-14T19:21:55Z")

</div>

This works for me:

```auto
    SampleData.SampleDataLogic.registerCustomSampleDataSource(
      sampleName='Mouse Head microCT Atlas',
      uris='https://github.com/muratmaga/mouse_CT_atlas/blob/3da1c36c057537384376155f347d08b34817fa5c/data/templates/35_mic_23strain_mus_template_UCHAR.nii.gz?raw=true',
      fileNames='35_mic_23strain_mus_template_UCHAR.nii.gz',
      nodeNames='Mus',
      )

```

---

<div class="post-metadata">

**Author:** ![smrolfe](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/smrolfe/32/3659_2.png) [@smrolfe](https://discourse.slicer.org/u/smrolfe)\
**Post date:** [December 14, 2018, 7:47pm UTC](https://discourse.slicer.org/t/is-datastore-upload-working/5071/10 "2018-12-14T19:47:33Z")

</div>

This works for me too, thanks @lassoan.

---

<div class="post-metadata">

**Author:** ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)\
**Post date:** [December 14, 2018, 8:11pm UTC](https://discourse.slicer.org/t/is-datastore-upload-working/5071/11 "2018-12-14T20:11:36Z")

</div>

Works for me too as it is.  
So, loadFileType=‘Volume Sequence’ tag is not necessary, then?

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [December 14, 2018, 8:13pm UTC](https://discourse.slicer.org/t/is-datastore-upload-working/5071/12 "2018-12-14T20:13:23Z")

</div>

You need to define “Volume Sequence” if you want the data set to be loaded as a volume sequence (4D volume).

---

<div class="post-metadata">

**Author:** ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)\
**Post date:** [December 14, 2018, 8:17pm UTC](https://discourse.slicer.org/t/is-datastore-upload-working/5071/13 "2018-12-14T20:17:13Z")

</div>

Is there some documentation for the tags that I have to use and what they can be set as ? I am trying with a mrb scene now, and I had the same issue as before, ie., downloads but doesn’t load into Slicer.

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [December 14, 2018, 8:30pm UTC](https://discourse.slicer.org/t/is-datastore-upload-working/5071/14 "2018-12-14T20:30:05Z")

</div>

You can use standard Python `help` method to get documentation of any method or class.

```auto
>>> import SampleData
>>> help(SampleData.SampleDataLogic.registerCustomSampleDataSource)

Help on function registerCustomSampleDataSource in module SampleData:

registerCustomSampleDataSource(category='Custom', sampleName=None, uris=None, fileNames=None, nodeNames=None, customDownloader=None, thumbnailFileName=None, loadFileType='VolumeFile', loadFileProperties={})
    Adds custom data sets to SampleData.
    :param category: Section title of data set in SampleData module GUI.
    :param sampleName: Displayed name of data set in SampleData module GUI.
    :param thumbnailFileName: Displayed thumbnail of data set in SampleData module GUI,
    :param uris: Download URL(s).
    :param fileNames: File name(s) that will be loaded.
    :param nodeNames: Node name in the scene.
    :param customDownloader: Custom function for downloading.
    :param loadFileType: file format name ('VolumeFile' by default).
    :param loadFileProperties: custom properties passed to the IO plugin.

```

File reader plugin name (loadFileType) is defined in each reader plugin. New plugins can be specified in any module in any extension, so there is no “list”. You can find most of them mentioned in [https://github.com/Slicer/Slicer/blob/master/Base/Python/slicer/util.py](https://github.com/Slicer/Slicer/blob/master/Base/Python/slicer/util.py) - search for `filetype`.

---

<div class="post-metadata">

**Author:** ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)\
**Post date:** [December 14, 2018, 8:44pm UTC](https://discourse.slicer.org/t/is-datastore-upload-working/5071/15 "2018-12-14T20:44:27Z")

</div>

Thanks Andras. This is very useful.

---

<div class="post-metadata">

**Author:** ![smrolfe](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/smrolfe/32/3659_2.png) [@smrolfe](https://discourse.slicer.org/u/smrolfe)\
**Post date:** [December 19, 2018, 11:21pm UTC](https://discourse.slicer.org/t/is-datastore-upload-working/5071/16 "2018-12-19T23:21:58Z")

</div>

The issue with loading an MRB file when registering a custom data source is documented [here](https://issues.slicer.org/view.php?id=4668) and fixed in [r27666](http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&revision=27666). Thanks for your advice @lassoan.
