File: manualpicker.h

package info (click to toggle)
relion 1.4%2Bdfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 4,188 kB
  • sloc: cpp: 42,912; sh: 10,415; makefile: 267; ansic: 50; csh: 2
file content (124 lines) | stat: -rw-r--r-- 3,216 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
/***************************************************************************
 *
 * Author: "Sjors H.W. Scheres"
 * MRC Laboratory of Molecular Biology
 *
 * 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; either version 2 of the License, or
 * (at your option) any later version.
 *
 * 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.
 *
 * This complete copyright notice must be included in any revised version of the
 * source code. Additional authorship citations may be added, but existing
 * author citations must be preserved.
 ***************************************************************************/

#ifndef MANUALPICKER_H_
#define MANUALPICKER_H_
#include "src/metadata_table.h"
#include "src/args.h"
#include "src/filename.h"
#include "src/gui_entries.h"
#include <Fl/Fl.H>
#include <Fl/Fl_Shared_Image.H>
#include <Fl/Fl_Double_Window.H>
#include <Fl/Fl_Scroll.H>
#include <Fl/Fl_Image.H>
#include <Fl/Fl_JPEG_Image.H>
#include <Fl/Fl_Box.H>
#include <Fl/fl_draw.H>
#include <Fl/Fl_Menu_Bar.H>
#include <Fl/Fl_File_Chooser.H>
#include <Fl/Fl_Float_Input.H>
#include <Fl/Fl_Text_Display.H>

#define MWCOL1 300
#define MWCOL2 60
#define MWCOL3 60
#define MWCOL4 60
#define MXCOL0 30
#define MXCOL1 (MXCOL0 + MWCOL1 + 10)
#define MXCOL2 (MXCOL1 + MWCOL2 + 10)
#define MXCOL3 (MXCOL2 + MWCOL3 + 10)
#define TOTALWIDTH (MWCOL1 + MWCOL2 + MWCOL3 + MWCOL4 + 100)
#define TOTALHEIGHT 500

// The button for picking particles
void cb_viewmic(Fl_Widget* w, void* data);
// The button for viewing the CTF
void cb_viewctf(Fl_Widget* w, void* data);
// The selection button
void cb_selectmic(Fl_Widget* w, void* data);

// This class only puts scrollbars around the resizable canvas
class manualpickerGuiWindow : public Fl_Window
{
public:

	// Input, picking & output names
	FileName fn_in, fn_out;

	// MetaDataTable of input micrographs
	MetaDataTable MDin;

	// Constructor with w x h size of the window and a title
	manualpickerGuiWindow(int W, int H, const char* title=0): Fl_Window(W, H, title){}

	// Fill the window with all entries
	int fill();

private:

    static void cb_menubar_save(Fl_Widget*, void*);
    inline void cb_menubar_save_i();

    static void cb_menubar_quit(Fl_Widget*, void*);
    inline void cb_menubar_quit_i();

    static void cb_menubar_recount(Fl_Widget*, void*);
    inline void cb_menubar_recount_i();

    void readOutputStarfile();
    void writeOutputStarfile();

};

class ManualPicker
{
public:

	// I/O Parser
	IOParser parser;

	// The input micrographs
	MetaDataTable MDin;

	// Input, picking & output names
	FileName fn_in, fn_out;


public:
	// Read command line arguments
	void read(int argc, char **argv);

	// Print usage instructions
	void usage();

	// Initialise some general stuff after reading
	void initialise();

	// General function to decide what to do
	void run();

private:

	void writeOutput();

};

#endif /* MANUALPICKER_H_ */