# mne.io.\_digitization

**URL:** <https://mne.discourse.group/t/mne-io-digitization/8375>\
**Category:** Support & Discussions\
**Tags:** microstates\
**Created:** [February 21, 2024, 8:36pm UTC](https://mne.discourse.group/t/mne-io-digitization/8375 "2024-02-21T20:36:36Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Matt](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/matt/32/2960_2.png) [@Matt](https://mne.discourse.group/u/Matt)\
**Post date:** [February 21, 2024, 8:36pm UTC](https://mne.discourse.group/t/mne-io-digitization/8375/1 "2024-02-21T20:36:36Z")

</div>

- MNE version: 1.6.1

Hi, I had previously pickled microstate classes (using pycrostates) as json files. Since I updated to mne1.6.1 I now get an error when I try to use pickle.load() to read them back in:

```python
ModK = pickle.load(Ks)

ModuleNotFoundError: No module named 'mne.io._digitization'

```

This does not happen when I go back to mne1.4.2.  
I am not sure if [mne.io](http://mne.io).\_digitization was replaced and there is another way to read these types of files in now or if there are other ways around this. Please advise.  
I am also not certain if turning them into josn files originally was the best choice, so if there is a better way to save that type of data I would be interested to hear what people recommend.

Best,  
Matt

---

<div class="post-metadata">

**Author:** ![richard](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/richard/32/15_2.png) [@richard](https://mne.discourse.group/u/richard)\
**Post date:** [February 22, 2024, 6:56am UTC](https://mne.discourse.group/t/mne-io-digitization/8375/2 "2024-02-22T06:56:15Z")

</div>

Hello,

pickling is a bad idea for long-term storage, as you just experienced.

I believe the pycrostate clustering classes all offer a `.save()` method, which is what you should use to store the results to disk.

Best wishes,  
Richard

---

<div class="post-metadata">

**Author:** ![mscheltienne](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/mscheltienne/32/827_2.png) [@mscheltienne](https://mne.discourse.group/u/mscheltienne)\
**Post date:** [February 22, 2024, 7:37am UTC](https://mne.discourse.group/t/mne-io-digitization/8375/3 "2024-02-22T07:37:12Z")

</div>

Any reason why you did not use the `save` method?

[https://pycrostates.readthedocs.io/en/latest/api/generated/pycrostates.cluster.ModKMeans.html#pycrostates.cluster.ModKMeans.save](https://pycrostates.readthedocs.io/en/latest/api/generated/pycrostates.cluster.ModKMeans.html#pycrostates.cluster.ModKMeans.save)

Mathieu

---

<div class="post-metadata">

**Author:** ![Matt](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/matt/32/2960_2.png) [@Matt](https://mne.discourse.group/u/Matt)\
**Post date:** [February 23, 2024, 7:37pm UTC](https://mne.discourse.group/t/mne-io-digitization/8375/4 "2024-02-23T19:37:34Z")

</div>

Thanks @richard and @mscheltienne, I see that now. I was simply unaware that there was a .save() method built in. I will read the docs a little closer next time. I will go use that now.

Thanks,  
Matt

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [March 1, 2024, 7:38pm UTC](https://mne.discourse.group/t/mne-io-digitization/8375/5 "2024-03-01T19:38:35Z")

</div>

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
