-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replacing ij.text.TextPanel with java.io.FileWriter - #3
- Loading branch information
Showing
4 changed files
with
74 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
/***=============================================================================== | ||
* | ||
* MotiQ_Thresholder plugin for imageJ | ||
* | ||
* Copyright (C) 2015-2024 Jan N. Hansen | ||
* First version: January 05, 2015 | ||
* This Version: July 31, 2024 | ||
* | ||
* This program is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU General Public License | ||
* as published by the Free Software Foundation (http://www.gnu.org/licenses/gpl.txt ) | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public | ||
* License along with this program. If not, see | ||
* <http://www.gnu.org/licenses/gpl-3.0.html>. | ||
* | ||
* For any questions please feel free to contact me ([email protected]). | ||
* | ||
* =============================================================================**/ | ||
|
||
package motiQ_thr; | ||
|
||
import java.io.File; | ||
import java.io.FileWriter; | ||
import java.io.IOException; | ||
|
||
class OutputTextFile { | ||
String path; | ||
FileWriter writer = null; | ||
String output; | ||
|
||
public OutputTextFile(String outputPath) { | ||
output = ""; | ||
path = outputPath; | ||
} | ||
|
||
public void append(String text) { | ||
output += (text + "\n"); | ||
} | ||
|
||
public boolean finish() { | ||
if(output.length() == 0) return false; | ||
if(path.length() == 0) return false; | ||
|
||
output = output.replaceAll("\n$", ""); | ||
|
||
try { | ||
writer = new FileWriter(new File(path)); | ||
writer.write(output); | ||
writer.close(); | ||
} catch (IOException e) { | ||
e.printStackTrace(); | ||
} | ||
output = ""; | ||
path = ""; | ||
return true; | ||
} | ||
|
||
public void changePath(String newOutputPath) { | ||
path = newOutputPath; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,8 +24,8 @@ | |
# Belongs to the MotiQ toolbox for analyzing cellular morphology, dynamics, and signaling (https://github.com/hansenjn/MotiQ). MotiQ_thresholder is a automated thresholding tool for image stacks. MotiQ thresholder calculates a threshold in a separate reference image and applies it to the input image. The reference image is optionally processed by MotiQ thresholder prior to threshold calculation, whereby the image histogram used for threshold calculation can be improved. | ||
|
||
# Author: Jan N. Hansen <[email protected]> | ||
# Version: 0.2.3 | ||
# Version: 0.2.4 | ||
# Date: 2017/09/15 | ||
# Requires: ImageJ | ||
|
||
Plugins>MotiQ, "MotiQ Thresholder (v0.2.3)", motiQ_thr.Thresholder | ||
Plugins>MotiQ, "MotiQ Thresholder (v0.2.4)", motiQ_thr.Thresholder |