jmarini / nanoscope Goto Github PK
View Code? Open in Web Editor NEWLibrary to parse and process Nanoscope Dimension AFM files.
License: MIT License
Library to parse and process Nanoscope Dimension AFM files.
License: MIT License
nanoscope.py, line 137, in _read_image_data
raw_data = (np.frombuffer(file_object.read(data_size * number_points),
ValueError: buffer is smaller than requested size
Works with Nanoscope files that are perfectly square sized, but anything with unequal lines and samples per line does not work as the buffer is not set up right. If there is any insight into fixing this that would be fantastic.
Currently reading in a file is a clunky multi-step process for the user. It should be more streamlined and support various io methods (i.e. StringIO).
Imports nanoscope in setup.py to single source version, but this fails since the required dependencies are not yet installed.
Add support for the full range of default colortables shipped with the tool software and add an api for the user to easily define their own.
Add proper documentation beyond docstrings
I know you've stated there are hardcoded dependencies for certain versions, so this issue is already known. I've tried running the software with check_version=False, in which case the read() operation succeeds and returns a <nanoscope.nanoscope.NanoscopeFile> object. When trying to do any processing however, it returns a NoneType object. I've checked the methods and there are no images in the list_images. Is this package only designed for image files then? I'm unsure if the problem is because of the version or because I'm processing curves not images.
Please let me know if you have any advice on correctly pulling the F-D data from the binary portion of the file!
I get an import error when I put in the nanoscope I get an error even though I am using the c ++ runtime. I don't know the cause winerror 126 occurs
Traceback (most recent call last): File "C:\Users\osako\anaconda3\envs\unsupervisedLearning\lib\site-packages\nanoscope\dll.py", line 41, in load datasource_dll = ctypes.cdll.LoadLibrary("DataSourceDLL") File "C:\Users\osako\anaconda3\envs\unsupervisedLearning\lib\ctypes_init.py", line 426, in LoadLibrary return self.dlltype(name) File "C:\Users\osako\anaconda3\envs\unsupervisedLearning\lib\ctypes_init.py", line 348, in init self._handle = _dlopen(self._name, mode) OSError: [WinError 126] 指定されたモジュールが見つかりません。 During handling of the above exception, another exception occurred: Traceback (most recent call last): File "", line 1, in File "C:\Users\osako\anaconda3\envs\unsupervisedLearning\lib\site-packages\nanoscope_init_.py", line 7, in from . import files, structures, constants, tools, dll, examples File "C:\Users\osako\anaconda3\envs\unsupervisedLearning\lib\site-packages\nanoscope\files_init_.py", line 8, in from .base import File File "C:\Users\osako\anaconda3\envs\unsupervisedLearning\lib\site-packages\nanoscope\files\base.py", line 11, in from .. import dll as _dll File "C:\Users\osako\anaconda3\envs\unsupervisedLearning\lib\site-packages\nanoscope\dll.py", line 78, in _dll = _load() File "C:\Users\osako\anaconda3\envs\unsupervisedLearning\lib\site-packages\nanoscope\dll.py", line 43, in _load raise WindowsError("DLL load failed, " OSError: DLL load failed, please check the installation.
Hi,
I have some piezoresponse data which seems to give problems to your code. If I run:
import nanoscope as n
import io
file = io.open('fname','rb')
n.nanoscope.NanoscopeFile(file,header_only=True).config['_Images']['Phase']
I get:
{'Aspect Ratio': '1:1',
'Bytes/pixel': 2,
'Capture start line': 0,
'Color Table Index': 12,
'Data Type Description': None,
'Data length': 262144,
'Data offset': 867392,
'Data type': 'AFM',
'Description': 'Phase1',
'Frame direction': 'Down',
'Highpass': 0,
'Image Data': 'Phase',
'Invalid Data Fill': None,
'Invalid Data Flag': None,
'Line Direction': 'Retrace',
'Lowpass': 0,
'Note': None,
'Number of lines': 256,
'Offline Planefit': None,
'Plane fit': 0,
'Realtime Planefit': 'Offset',
'Relative frame time': 2561.29,
'Samps/line': 256,
'Scan Line': 'Main',
'Scan Size': 500,
'Start context': 'OL',
'Tip x width correction factor': 1,
'Tip x width correction factor sigma': 1,
'Tip y width correction factor': 1,
'Tip y width correction factor sigma': 1,
'Valid data len X': 256,
'Valid data len Y': 256,
'Valid data start X': 0,
'Valid data start Y': 0,
'Z magnify': 1.0,
'Z offset': Z offset: [None] (0.005493164 º/LSB) 0.0 deg,
'Z scale': Z scale: [None] (0.005493164 º/LSB) 360.0 deg}
Where you can see that Z offset
and Z scale
are set to None
. So that when I run:
import nanoscope as n
import io
file = io.open('fname','rb')
n.nanoscope.NanoscopeFile(file,header_only=True).config['_Images']['Phase']['Z offset'].soft_scale
There is no output. Hence nanoscope.read
breakes while running the _get_sensitivity_value
function. Is there quick fix that you can suggest by any chance?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.