Closed thanneken closed 6 years ago
I assume it revolves around
int extensionIndex = listOfHemisphereCaptures[i].getName().indexOf(".");
if (extensionIndex != -1)
{
String simpleName1 = listOfHemisphereCaptures[i].getName().substring(0, extensionIndex);
String simpleName2 = projectName + "_";
String simpleName3 = simpleName1.substring(simpleName1.indexOf("RTI-"));
filePath = projectDirectory+"AccurateColorRTI"+File.separator+"AccurateColor_"+simpleName2+simpleName3;
simpleImageName = "AccurateColor_"+simpleName2+simpleName3;
}
where String simpleName3 = simpleName1.substring(simpleName1.indexOf("RTI-"));
ended up as String simpleName3 = simpleName1.substring(-1);
which would throw that error.
The names of your paths in your hemisphere folder did not contains "RTI-". This was a way of grabbing the file names correctly in previous runs. The check for it here is no longer needed. I will rewrite these spots.
The second error happens from the differences in how OS's handle falsiness. In this case, I believe it revolves around
File[] listOfTransmissiveSources_dir = new File[0];
List<String> listOfTransmissiveSources_list = new ArrayList<>();
List<String> listOfTransmissiveSources_short = new ArrayList<>();
String[] listOfTransmissiveSources;
String[] listOfTransmissiveSourcePaths;
listOfTransmissiveSources = new String[transmissive_gamma_dir.listFiles().length];
listOfTransmissiveSourcePaths = new String[transmissive_gamma_dir.listFiles().length];
if(transmissive_gamma_dir.exists() && transmissive_gamma_dir.length() > 0){
listOfTransmissiveSources_dir=transmissive_gamma_dir.listFiles();
for (File f : listOfTransmissiveSources_dir){
listOfTransmissiveSources_list.add(f.toString());
listOfTransmissiveSources_short.add("..."+f.getName());
}
if(shortName){
listOfTransmissiveSources_short.toArray(listOfTransmissiveSources);
}
else{
listOfTransmissiveSources_list.toArray(listOfTransmissiveSources);
}
listOfTransmissiveSources_list.toArray(listOfTransmissiveSourcePaths);
}
else{
listOfTransmissiveSources = new String[0];
}
Arrays.sort(listOfTransmissiveSourcePaths);
Arrays.sort(listOfTransmissiveSources);
It needs to be rewritten to explicitly avoid null scenarios like
File[] listOfTransmissiveSources_dir = new File[0];
List<String> listOfTransmissiveSources_list = new ArrayList<>();
List<String> listOfTransmissiveSources_short = new ArrayList<>();
String[] listOfTransmissiveSources;
String[] listOfTransmissiveSourcePaths;
if(transmissive_gamma_dir.exists()){
listOfTransmissiveSources = new String[transmissive_gamma_dir.listFiles().length];
listOfTransmissiveSourcePaths = new String[transmissive_gamma_dir.listFiles().length];
if (transmissive_gamma_dir.length() > 0){
listOfTransmissiveSources_dir=transmissive_gamma_dir.listFiles();
for (File f : listOfTransmissiveSources_dir){
listOfTransmissiveSources_list.add(f.toString());
listOfTransmissiveSources_short.add("..."+f.getName());
}
if(shortName){
listOfTransmissiveSources_short.toArray(listOfTransmissiveSources);
}
else{
listOfTransmissiveSources_list.toArray(listOfTransmissiveSources);
}
listOfTransmissiveSources_list.toArray(listOfTransmissiveSourcePaths);
}
}
else{
listOfTransmissiveSources = new String[0];
listOfTransmissiveSourcePaths = new String[0];
}
These rewrites did not cause errors on Windows 7, it should be safe to test for the same errors produced before with Linux once I upload the new .jar
That seems to have done the trick. Successful run on Linux...
Last week at the workshop someone brought data that should have worked, but didn't. I just ran it under Windows and got further than I did on Linux, but not very far. It asked for the static raking light positions and created the directory "AccurateColorRTI" and then failed with the following in console:
On Linux it goes only as far as creating the directory for StaticRaking then fails as follows:
I don't find these error messages meaningful. The first thing I checked was to see if the tif files had any headers that confused ImageJ. That was not the case. Then I tested the data with the macro and it worked fine. The filenames are a little different but within spec (no spaces or special characters).
Any ideas?