を検出することを含みます。
今100個のサンプルでこれらの領域を拡大するために、私は画像処理のトリックを使用します:画像膨張:
SE = strel('arbitrary', ones(100,1))
extractVector=imdilate(overThresh,SE)
今extractVectorは(それらの隣にしきい値+ 100を介して)したいサンプルのために真であります。
interestingSamples=sampleMatrix(extractVector,:)
これは、あなたのすべての列の値を持つ行列を与えるが、興味のある行のみ
編集:。 あなたが使用して、しきい値違反の各イベントにラベル(整数)を割り当てることができますが:
overthreshLabeled=bwlabel(overthresh);
ここで、各領域は「真」の代わりに数字で構成されます。各番号は隣接するイベントの特定の領域に対応し、閾値を超えている。 次に、リージョン番号をループして値を抽出し、セルにすべて入れることができます(長さが異なるため、セルにする必要があります)。
ROIs{1,max(labeledThreshold)}=[]; % preallocation
for i=1:max(labeledThreshold)
region=labeledThreshold==i;
extractVector=imdilate(overThresh,SE) % Note: set SE before loop
ROIs{1,i}=sampleMatrix(extractVector,:)
end
偉大な、これは私が求めたすべてです。今私が拡大する場合、私は同じサンプルマトリックスを持っており、閾値に違反する2つの別々のインシデントを持っていると言う。両方のイベントを別々の行列としてどのように抽出することができますか? – MRaff16
編集:正しいコードマークアップを得るための答えを更新します –
だから私のコードは今これです。 'overThresh_high =データ(:、3)> 50.2; overthreshLabeled = bwlabel(overThresh_high); SE_high = strel( '任意'、1(3000,1)); ROI {1、max(overthreshLabeled)} = []; %preallocation i = 1の場合:max(overthreshLabeled) region = overthreshLabeled == i; extractVector = imdilate(overThresh_high、SE_high); %注:ループ前にSEを設定する ROIs {1、i} =データ(extractVector、:); end' – MRaff16