Applies 2D wavelet transforms in MATLAB for image decomposition, medical image denoising (MRI/CT/ultrasound), custom wavelet design, feature extraction, and deep learning integration.
npx claudepluginhub rrmaram2000/matlab-toolbox-skills --plugin matlab-toolbox-skillsThis skill uses the workspace's default tool permissions.
Expert skill for 2D wavelet analysis in MATLAB. Focus areas: custom wavelet design via lifting schemes, medical image analysis (MRI/CT/ultrasound), and deep learning integration.
knowledge/INDEX.mdknowledge/cards/2d-transforms.mdknowledge/cards/custom-wavelets.mdknowledge/cards/deep-learning.mdknowledge/cards/denoising.mdknowledge/cards/dual-tree.mdknowledge/cards/filters.mdknowledge/cards/medical-imaging.mdknowledge/cards/shearlets.mdknowledge/mathematical-foundations.mdscripts/template_ct_denoising.mscripts/template_custom_lifting_wavelet.mscripts/template_deep_learning_wavelet.mscripts/template_dual_tree_directional.mscripts/template_image_fusion.mscripts/template_mri_denoising.mscripts/template_multiresolution_analysis.mscripts/template_shearlet_curvilinear.mscripts/template_ultrasound_speckle.mscripts/template_wavelet_feature_extraction.mProcesses medical images with MATLAB Image Processing Toolbox: denoising, enhancement, segmentation, morphological operations, cell counting for MRI, CT, microscopy, histology.
Designs and validates digital filters in MATLAB for cleaning noisy signals, removing interference, FIR/IIR lowpass/highpass/bandpass/bandstop/notch filters, and Filter Analyzer comparisons.
Processes microscopy and bioimage images with scikit-image: read/write, filter (Gaussian, median, LoG), segment (thresholding, watershed, active contours), measure regions, detect features. NumPy/SciPy integration.
Share bugs, ideas, or general feedback.
Expert skill for 2D wavelet analysis in MATLAB. Focus areas: custom wavelet design via lifting schemes, medical image analysis (MRI/CT/ultrasound), and deep learning integration.
Open the relevant knowledge card before writing code:
| Task | Knowledge File |
|---|---|
| Mathematical foundations (MRA, Daubechies, PR conditions) | knowledge/mathematical-foundations.md |
| Custom wavelet design / learning wavelets from data | knowledge/cards/custom-wavelets.md |
| MRI/CT/ultrasound processing | knowledge/cards/medical-imaging.md |
| Choosing which wavelet for your image type | knowledge/cards/filters.md |
| When to use which 2D transform | knowledge/cards/2d-transforms.md |
| Denoising method selection & recipes | knowledge/cards/denoising.md |
| Directional edge detection guidance | knowledge/cards/dual-tree.md |
| Curvilinear features (vessels/fibers) | knowledge/cards/shearlets.md |
| Deep learning + wavelet integration patterns | knowledge/cards/deep-learning.md |
wmaxlev(size(img), wname) before decomposition'symmetric' for medical imagesAnalysis type?
├── Standard 2D decomposition
│ ├── Critically sampled → wavedec2/waverec2
│ └── Shift-invariant → swt2/iswt2 (MODWT is 1D only)
├── Directional analysis
│ ├── 6 orientations → dualtree2/idualtree2
│ └── Curvilinear (vessels) → shearletSystem
├── Custom wavelet design
│ └── Lifting scheme → liftingScheme + lwt2/ilwt2
└── Time-frequency (signals)
└── CWT → cwt/icwt
| Image Type | Wavelet | Rationale |
|---|---|---|
| Medical (MRI, CT) | db4-db8 | Good edge preservation |
| Smooth gradients | sym6-sym8 | Higher vanishing moments |
| Sharp edges | db2-db4 | Shorter filters |
| Compression | bior4.4, bior6.8 | Symmetric (linear phase) |
[C, S] = wavedec2(img, 4, 'db4');
cA = appcoef2(C, S, 'db4'); % Approximation
cH = detcoef2('h', C, S, 1); % Horizontal detail, level 1
imgRec = waverec2(C, S, 'db4');
% MRI (Rician noise)
mriClean = wdenoise2(mri, 'DenoisingMethod', 'Bayes', ...
'Wavelet', 'sym4', 'Level', 4);
% Valid methods: 'UniversalThreshold', 'Minimax', 'SURE', 'Bayes', 'FDR'
% Ultrasound (multiplicative speckle)
logUS = log(1 + double(us));
denoised = wdenoise2(logUS, 'DenoisingMethod', 'Bayes');
usClean = exp(denoised) - 1;
ls = liftingScheme('Wavelet', 'haar');
ls = addlift(ls, liftingStep('Type', 'predict', ...
'Coefficients', [-0.5, 0.5], 'MaxOrder', 1));
ls = addlift(ls, liftingStep('Type', 'update', ...
'Coefficients', [0.25, 0.25], 'MaxOrder', 0));
[LL, LH, HL, HH] = lwt2(img, liftingScheme=ls);
[a, d] = dualtree2(img, Level=3);
% d{level}(:,:,dir) for 6 directions: ±15°, ±45°, ±75°
x = dlarray(img, 'SSCB');
[A, D] = dldwt(x, Wavelet='db4'); % A=approx, D=detail (concatenated)
% For 2D: D(:,:,1,:)=H, D(:,:,2,:)=V, D(:,:,3,:)=D subbands
xRec = dlidwt(A, D, Wavelet='db4'); % Inverse transform
Ready-to-use .m files in scripts/ -- read and adapt for your task:
| Template | Use Case |
|---|---|
template_mri_denoising.m | MRI Rician noise removal pipeline |
template_ct_denoising.m | CT Poisson noise with Anscombe transform |
template_ultrasound_speckle.m | Ultrasound speckle reduction (log-domain) |
template_multiresolution_analysis.m | Standard wavedec2 decomposition and visualization |
template_dual_tree_directional.m | Directional edge detection with dualtree2 |
template_shearlet_curvilinear.m | Vessel/fiber detection with shearlets |
template_custom_lifting_wavelet.m | Custom wavelet design via liftingScheme |
template_deep_learning_wavelet.m | Wavelet layers for deep learning (dldwt) |
template_image_fusion.m | Multi-modal image fusion (MRI+CT, PET+CT) |
template_wavelet_feature_extraction.m | Wavelet energy/entropy features for classification |
Unique content not in the model's training data -- prioritize reading:
Knowledge cards provide when-to-use guidance and decision frameworks for choosing transforms, wavelets, and methods.
See knowledge/INDEX.md for full navigation.