Git Product home page Git Product logo

qpformat's People

Contributors

paulmueller avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

dalerxli

qpformat's Issues

dm_convert can not find my TIF-images (stack)

Hello!
I have taken interferometric images with phasics SID4BIO camera using NIKONs NIS-elements software. I have successfully converted the interferometric images into phase and intensity images using MATLAB. I have then stacked the phase and intensity images using python , into a similar format as the PHASICS "SID PHA" format. However, drymass/qpformat can not seem to find my images with the command dm_convert.

This the code i use to convert my data to a TIF-stack:

from skimage import data, io, filters
from skimage.transform import resize
import numpy as np
import tifffile

#Read Intensity and Pahse tif images
inte = io.imread('Intensity.tif')
inte = resize(inte, (800, 864))
print(inte.shape)
print(inte.dtype)


phas = io.imread('Phase.tif')
phas = resize(phas, (800, 864))
print(phas.shape)
print(phas.dtype)


#Normalize with max of image
maxinte= np.max(inte)
maxphas=np.max(phas)

inte=inte/maxinte
phas=phas/maxphas

print('max Intensity :',np.max(inte))
print('max Phase :',np.max(phas))


#Create stack of Intensity and Phase data
stack=np.array([inte,phas,phas])
print(stack.shape)
print(stack.dtype)


#save images, in two formats.
tifffile.imwrite('sensor_data.tif',stack)

tifffile.imwrite('multi-channel_resized.tif', stack,photometric='minisblack', metadata={'axes': 'IYX'})

And this is the error in the anaconda prompt:

(Master) C:\Users\samue\Documents\Master-Thesis\Pyhton\Test\160922-Bild-strack>dm_convert test
DryMass version 0.12.0
Traceback (most recent call last):
  File "C:\Users\samue\anaconda3\envs\Master\lib\runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\samue\anaconda3\envs\Master\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Users\samue\anaconda3\envs\Master\Scripts\dm_convert.exe\__main__.py", line 7, in <module>
  File "C:\Users\samue\anaconda3\envs\Master\lib\site-packages\drymass\cli\converting.py", line 15, in cli_convert
    path_in, path_out = dialog.main(path=path,
  File "C:\Users\samue\anaconda3\envs\Master\lib\site-packages\drymass\cli\dialog.py", line 110, in main
    ds = qpformat.load_data(path_in)
  File "C:\Users\samue\anaconda3\envs\Master\lib\site-packages\qpformat\core.py", line 73, in load_data
    fmt = guess_format(path)
  File "C:\Users\samue\anaconda3\envs\Master\lib\site-packages\qpformat\core.py", line 13, in guess_format
    if fmt.verify(path):
  File "C:\Users\samue\anaconda3\envs\Master\lib\site-packages\qpformat\file_formats\fmts_ready\series_phase_phasics_tif_zip.py", line 85, in verify
    zf = zipfile.ZipFile(path)
  File "C:\Users\samue\anaconda3\envs\Master\lib\zipfile.py", line 1248, in __init__
    self.fp = io.open(file, filemode)
PermissionError: [Errno 13] Permission denied: 'C:\\Users\\samue\\Documents\\Master-Thesis\\Pyhton\\Test\\160922-Bild-strack\\test'

Support raw Phasics files using qpretrieve

They could be identified via the TIF tags:

# tf is tifffile.TiffFile object)
In [21]: [(key, tf.pages[0].tags[key].value) for key in dict(tf.pages[0].tags)]
Out[21]: 
[(256, 1600),
 (257, 1200),
 (258, 16),
 (259, <COMPRESSION.NONE: 1>),
 (262, <PHOTOMETRIC.MINISBLACK: 1>),
 (266, <FILLORDER.MSB2LSB: 1>),
 (273, (8,)),
 (274, <ORIENTATION.TOPLEFT: 1>),
 (277, 1),
 (278, 1200),
 (279, (3840000,)),
 (282, (1073741824, 1073741824)),
 (283, (1073741824, 1073741824)),
 (284, <PLANARCONFIG.CONTIG: 1>),
 (296, <RESUNIT.NONE: 1>),
 (305, 'National Instruments IMAQ'),
 (339, <SAMPLEFORMAT.UINT: 1>)]
``

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.