SMAK 3
Now in Python!
If you have SMAK 2 or earlier and want the latest features and support, click here for instructions on how to do a new install of SMAK 3 with Anaconda.
SMAK 2 is still available for download here but is no longer supported.
Latest Release - 3.0.11
September 12th 2024
Click here for version history and features list
Update existing Python installation
-
Open Anaconda/Terminal/Command Prompt.
-
Activate the environment you use to run smak
conda activate smakenv
Then:
Option 1) pip install smak
Run SMAK and check the version in the "About" menu. If SMAK has not updated then move to option 2.
Option 2) pip install smak==X.X.X where X.X.X is the latest version number, e.g. 3.0.9
NOTE:
This will overwrite any of the settings files in your smak distribution folder. Of most importance is your temp directory settings (smakworkpath.pth) and the Workflow definition (batchCommands.json) files. Please back up these files if you have made significant changes to your files and do not want to lose them!
New installations
Anaconda required!
You MUST have Anaconda 3 installed first in order to install and use SMAK 3.0. Go to https://www.anaconda.com/download to download and follow the installation instructions.
Note that text in this font represents command text you need to enter into Anaconda/Terminal/Command Prompt.
-
Create a new environment from the Anaconda navigator/Terminal/Command Prompt.
-
conda create -n smakenv python==3.10
Choose 'y' when prompted. -
Activate the new environment.
conda activate smakenv -
Install package via pip
pip install smak -
Navigate to the folder within your anaconda environment where SMAK has been installed. This can be tricky to find.
-
To start, type in PATH (Windows) or $PATH (Mac).
This will provide a list of Anaconda directories. Yours may look something like this: "C:\Users\yourUsername\AppData\Local\anaconda3\envs\smakenv" (windows) -
Using this path, navigate to that folder on your computer in (File Explorer - Windows), (Finder - Mac). This is the folder for your SMAK specific virtual environment.
-
From this virtual environment folder, navigate to "Lib\site-packages\smak" (Windows) or "Lib\python3.10\site-packages\smak" (Mac).
-
In this folder, you will see the code for smak, including "smak.py". Bookmark this folder, you will need to access it frequently.
-
Optional feature install: Segmentation and image registration
To use the full functionality of SMAK, you will need to follow a few additional steps. This is not necessary unless you plan to use segmentation and image registration. If you want to skip this step click here or scroll down this page.
Download the files from the following links. They are quite large and may take a while to download.
-
Move the files into the main smak folder. This is the folder you found and bookmarked in step 5 of "Installation with Conda".
-
From Anaconda prompt, activate the smak environment (if not already active) with:
conda activate smakenv
Then run the following commands to install packages. Please follow this exact order of package installation.
-
pip install pycocotools
-
pip install git+https://github.com/facebookresearch/segment-anything.git
-
pip install torch
-
pip install torchvision
-
conda install lap -c conda-forge
-
pip install numpy==1.24
There is a chance that the installation in point 2 above (the pip install git+https) may not work if the git extensions to python is not installed. If you run into this issue, issue a conda install git command before the pip install git+https step.
To check this functionality, open SMAK and navigate to the Analyze/Segmentation. An expanded menu including "Initialize SAM" will be available to you.
Run/Open SMAK
-
Open Anaconda/Terminal/Command Prompt.
-
Activate the environment you use to run smak
conda activate smakenv -
Navigate to the folder within your anaconda environment where smak has been installed. This is the folder you found and bookmarked in step 5 above.
-
Run smak
python smak.py
Improvements on this installation process and guide are underway! In the meantime, don't hesitate to reach out to Joy (joy.a.wood@dartmouth.edu) or Sam (samwebb@slac.stanford.edu) for assistance.
SMAK 3 version history
Latest Release - 3.0.11
September 12th 2024
-
Installer bug fix for dependencies that have upgraded to numpy2.0
-
Bug updates, fixing errors in loading/saving PyMCA configuration files
-
Update input file formats for APS GSECARS h5 data
-
Added Renishaw Raman formats
-
Added direct read fro OMNIC map files (rather than ENVI export)
-
Fix TIFF file loading for multiple/single channel data, and 16bit TIFF data
-
Restored qpTIFF data input
-
Fixed x-axis imports for imzML data
-
Added Multilayer TIFF (OMTiff) support for data import and export
-
Added zero-padding support for Horiba data that have been aborted
-
Conversions for visible camera data to HSV, XYZ, YCrCb, RGB, LAB coordinates
-
FTIR math conversion from %T to Absorbance
-
Added manual adjustments for SSRL image mosaics
-
Fixed: absolute derivative math
-
Fixed: regression and multi-regression from correlation plot
-
Fixed: color plot options in correlation plot
-
Fixed: multi-correlation plot options
-
Can export correlation plots when using color masking to separate data columns
-
Correlation plots can use camera RED/GREEN/BLUE to color code data points
-
Added export data as animated GIF for "movies"
-
Create spectrum plots based on masks/cluster plots
-
Optional color palettes for line plots
-
Fixed coordinate transforms in flip/rotation of data files
-
Raman/FTIR peak fitting added
-
Added better transparency options for low values for the multifader
-
Added tricolor map option in multifader
-
Workflow fixes for several options
-
Workflow additions for new features
-
Option to save/load PCA results
-
Fixed multiple process spawning for FTIR background removal
-
Added instructions in forum for creating Mac desktop icons
3.0.9
February 9th 2024
-
Bug update, fixing a few small errors ....
-
Fix the Vitesse TOF-MS data format for data with missing lines
-
Fixed minor error in particle detection in watershed analysis
-
Added channel stitching mode for strict overlay s. machine vision stitching
-
Added side removal option for mosaic formation for removing occluding objects
-
Fixed bug in edge removal workflow
-
Added multi-channel transect cross section report
-
Added elliptical radial integration analysis
-
Fixed errors in the circular radial analysis
-
Updated layout for concentration calibrations
-
Added ability to add ROI regions from a plot marker list, at defined radius from each marker. Can sort ROIs formed by marker color or shape.
3.0.8
November 15th 2023
-
Bug update, fixing a few small errors ....
-
Fix the Vitesse TOF-MS data format for proper coordinate readback.
-
Fixed data loading of "newer" ALS 10.3.2 data formats
-
Fixed loading of tiff images as data sets
-
Tweaked the data import for the Exum Massbox TOF-MS format.
-
Improved the mulit-fader display blending
-
Fixed an error where the "add channel from zoom" was flipped in the vertical direction.
-
Fixed an error with the export data to clipboard from the correlation plotter.
-
Added "Export ROI Data" to the particle statistics to add masks from the discovered particles as a data channel.
-
Improved the name matching for data labels in the standardization section for LA-MS data.
-
Fixed error on displaying scalebar text in tricolor plots
-
Fixed path error in PyMCA fitting.
-
Fixed error in reading saved information in the legacy quantification.
-
Fixed error for SiVM-PCA when a max no. PCA components was set.
3.0.7
October 18th 2023
-
Bug update, fixing a few small errors in the XANES fitting and a few other places.
-
Fix the Vitesse TOF-MS data format for vertical data collection
-
Add data import for the Exum Massbox TOF-MS format.
-
Weighted "groups" for PCA analysis to balance contributions from different multi-modal techniques.
-
Ability to add "tags" to a selected set of data channels for easier bulk processing
-
Update install scripts to account for a few small issues
3.0.6
October 2nd 2023
-
Biggest update yet!
-
Current and future versions of SMAK will be released in source code only, use on any 64 bit operating system.
-
Requires an installation of Python 3.10 (currently) for installation. The distribution is on GitHub (private) but can be installed from PyPi too!
-
Support for multi-modal image processing. See new formats below. I know I forgot a ton…
-
Batch mode! Can create workflows that do several steps to all open files. Workflows can be edited, saved and shared among users. Look for a Workflow forum on sams-xrays.com.We will be updating documentation and producing some workflow based routines soon too!MCA processing can process in energy or bins.
-
Created new procedure for quantitative analysis that is easier to use. Can make standard templates that are easy to use and re-use. Support for multiple plot regression in standardization.
Fixed radial graph maker. -
Can import data across data tabs, and import data maps with auto-resizing. Also created image export across tabs with visual image registration. Registration uses several different methods (ORB, AKAZE, SIFT, or a convolution neural network warp).
-
Added support for OCTAVVS FTIR background processing.
-
MCA can save data in multiple (up to 9) buffers which can be viewed together.
-
Can create MCA spectra from masks, or cluster plot regions. Save MCA after PyMCA shows multiple data frames (data, fit, background).
-
Fixed multi-file PCA processing. Correlation plots can be color coded to the colors of cluster maps.
-
Masks can be created by freehand, from correlation plots, using rectangular/circular shapes. Masked regions can be moved spatially, translated, scaled, etc. Can define masks via a slope relation in correlation plots. Invert mask function.
-
Cross-correlation plots can be created for multiple channels. Multi-fader can be used to combine multiple images in different colormaps.
-
XANES imaging fitting creates a “sum” channel in addition to the fit species.
-
New colormaps for display.
Added support for Meta’s Segment Anything Model (SAM - great acronym, right?). Segements can be created and saved. Segments fit into the particle/mask analysis routines. Added morphological analysis and export of parameters back to map channels. Added analysis for log(size) distribution and cumulative area plots.
New formats:
-
NSLS X26 binary
-
GSE-CARS updates
-
CLS updates
-
Diamond LS NXS files
-
ESRF SPEC files (ROBL beam line)
-
FTIR formats from Bruker, Agilent, and Thermo (ENVI format).
-
Updated TOF-MS and LA-MS files.
-
IMZML formats for MALDI-MS.
-
Horiba micro-Raman text file exports.
-
qTIFF and updated JPG/TIFF/PNG formats.
-
Mosaic brightfield camera images from SSRL image data collection.
-
FTIR formats will also save the full spectra in a “MCA” type file for processing.
SMAK Legacy Installations (prior to v3.0)
For previous versions of SMAK, click here