imagesc-34963

Created Diff never expires
7 removals
Lines
Total
Removed
Words
Total
Removed
To continue using this feature, upgrade to
Diffchecker logo
Diffchecker Pro
31 lines
11 additions
Lines
Total
Added
Words
Total
Added
To continue using this feature, upgrade to
Diffchecker logo
Diffchecker Pro
35 lines
import java.io.IOException;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.nio.file.Paths;
import java.util.regex.Pattern;
import java.util.regex.Pattern;
import java.util.regex.Matcher
import ij.IJ




public class DevelopTerraStitcherParsing
public class DevelopTerraStitcherParsing
{
{
public static void main( String[] args )
public static void main( String[] args )
{
{
String regExp = "t(?<T>\\d+)\\/c(?<C>\\d+)\\/.*\\/.*\\/.*\\/.*_(?<Z>\\d+).tif";
String regExp = "t(?<T>\\d+)\\/c(?<C>\\d+)\\/.*\\/.*\\/.*\\/.*_(?<Z>\\d+).tif";
regExp = regExp.replaceAll("/", Matcher.quoteReplacement(File.separator) );
regExp = regExp.replaceAll("/", Matcher.quoteReplacement(File.separator) );
Pattern pattern = Pattern.compile( regExp );
Pattern pattern = Pattern.compile( regExp );
System.out.println( regExp );
System.out.println( regExp );
final String directory = "/Users/tischer/Documents/bigdataprocessor2/src/test/resources/test/tiff-planes-multi-channel-subfolders/";
final String directory = "K:/Stitched_TeraStitcher/500 mf_20210604_113148/t000/sample/";


try
try
{
{
Files.walk( Paths.get( directory ) )
Files.walk( Paths.get( directory ) )
.forEach(f -> {
.each{f ->
final String relativePath = f.toString().replace( directory, "" );
String relativePath = f.toString().replace( directory, "" );
final boolean matches = pattern.matcher( relativePath ).matches();
boolean matches = pattern.matcher( relativePath ).matches();
System.out.println( relativePath + ": " + matches );
IJ.log( relativePath + ": " + matches );
} );
};
}
}
catch ( IOException e )
catch ( IOException e )
{
{
e.printStackTrace();
e.printStackTrace();
}
}
}
}
}
}