<jupyter_start><jupyter_text>| ![nsdf](https://www.sci.utah.edu/~pascucci/public/NSDF-smaller.PNG)  | [National Science Data Fabric](https://nationalsciencedatafabric.org/) [Jupyter notebook](https://jupyter.org/)  created by  [<NAME>](http://cedmav.com/) and  [<NAME>](https://www.sci.utah.edu/people/scrgiorgio.html)  |  |---|:---:| Distribution of the data related by the following paper:  4D micro-CT imaging of oil- and waterflood in water- and mixed-wet complex sandstones __Authors:__  _<NAME>, <NAME>, <NAME>, <NAME>, <NAME>, and <NAME>_ __Published in:__  Fluid invasion dynamics in porous media with complex wettability and connectivity. Geophysical Review Letters. 2021https://doi.org/10.1029/2021GL095185[Dataset available though  the Digital Rocks Portal](https://www.digitalrocksportal.org/projects/378)    This is a preview of the data:![Visualization of Covid-19 cases](https://www.sci.utah.edu/~pascucci/public/open_4D_micro_CT.gif)    Import modules and install them if missing. Check print message to see if the kernel should be restarted.<jupyter_code>import os,sys
try:
    import matplotlib.pyplot as plt, skimage, OpenVisus
except:
    !"{sys.executable}" -m pip install matplotlib scikit-image OpenVisus
    from IPython.display import display_html
    def restartkernel() :
        display_html('''<script>Jupyter.notebook.kernel.restart(); 
        setTimeout(function(){IPython.notebook.execute_all_cells();}, 10)</script>''',raw=True)
    restartkernel()
    print()
    print("********************************************************")
    print("** Restart jupyter kernel manually to use new modules **")
    print("********************************************************")
import matplotlib.pyplot as plt, skimage, OpenVisus<jupyter_output>Starting OpenVisus C:\Users\Vlaerio's PC\AppData\Roaming\Python\Python37\site-packages\OpenVisus\__init__.py 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:58:18) [MSC v.1900 64 bit (AMD64)] sys.version_info(major=3, minor=7, micro=9, releaselevel='final', serial=0) ...<jupyter_text>Connect to dataset and print basic information<jupyter_code>MicroCT=OpenVisus.LoadDataset('http://atlantis.sci.utah.edu/mod_visus?dataset=4D_micro_CT_sandstones&cached=1')
print("Scalar fields names=",MicroCT.getFields())
print("Dataset [x,y,z] dimensions=",MicroCT.getLogicBox()[1])<jupyter_output>Scalar fields names= ['data']
Dataset [x,y,z] dimensions= [1935, 1935, 1204]<jupyter_text>Get a slice and display<jupyter_code>fig, plots = plt.subplots(nrows=1, ncols=1)
fig.set_size_inches(18.5, 10.5)

#slice = MicroCT.getXSlice(150,-3)
slice = MicroCT.getXSlice()

im = plots.imshow(slice) 
plt.colorbar(im)
plt.show()
print("Slice horizontal dim=",slice.shape[1],"Slice vertical dim=",slice.shape[0])
%matplotlib widget
import numpy as np
import matplotlib.pyplot as plt
import ipywidgets as wd
fig, axes = plt.subplots()
axes.imshow(slice) #displaying the first image
import numpy as np
from bokeh.plotting import figure, show
from bokeh.models import LinearColorMapper, BasicTicker, ColorBar


data = np.random.rand(10,10)

color_mapper = LinearColorMapper(palette="Viridis256", low=0, high=1)

plot = figure(x_range=(0,1), y_range=(0,1))
plot.image(image=[data], color_mapper=color_mapper,
           dh=[1.0], dw=[1.0], x=[0], y=[0])

color_bar = ColorBar(color_mapper=color_mapper, ticker= BasicTicker(),
                     location=(0,0))

plot.add_layout(color_bar, 'right')

show(plot)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.16991963260619977, 'fraction_numerical': 0.03415614236509759, 'mean_word_length': 5.740812379110252, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 7, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '98662', 'license': 'MIT', 'n_tokens_mistral': 1293, 'n_tokens_neox': 1185, 'n_words': 261, 'path': 'materials-science/4D_micro_CT/open_4D_micro_CT_interactive.ipynb', 'repo_name': 'sci-visus/NSDF-examples', 'size': '3530'}