八月流水账

8.1 >_<

新的一个月!入新的大坑!

之前的导管定位应该要割了,在某些钼靶影像中的导管才是可见的,以及导管内部的肿瘤也是没办法在钼靶影像上看到的,确诊都是活体切片..

所以好像做这个可能做不出来而且临床意义不大 = =

搭环境 vs2015 + qt + vtk 

记录下踩的坑 0.0

报错 LINK : fatal error LNK1158: 无法运行“rc.exe”

在vs里面创建一个Qt项目没有窗口弹出,是因为建项目的时候没有勾出那些xxxxx东西,具体见这篇

 

8.2 >_<

py里遍历一个文件夹

import os
import os.path

rootdir = 'C:\\Users\\j\\Desktop\\trans\\data\\train'
F = open('test.txt',"w+")

for parent,dirnames,filenames in os.walk(rootdir):
    for filename in filenames:
        f = open('C:\\Users\\j\\Desktop\\trans\\data\\train\\' + filename)
        print (filename)
        #F.write(filename + '\n')
        line = f.readline()

        X = []
        Y = []
        while line:
            x = ''
            pos = 0
            for i in range(0,line.__len__()):
                if (line[i] == ' '):
                    pos = i
                    break;
                x = x + line[i]

            x = int(x)
            X.append(x)

            y = ''
            for i in range(pos+1,line.__len__()):
                y = y + line[i]
            y = float(y)
            Y.append(y)
            #print (x,y)
            line = f.readline()
View Code

在cmake里面配置VTK失败了,试了好几次都不得

后来是直接在vs里面建好项目,然后在项目的属性里面添加VTK的东西

一个三维的可以旋转的线段>_<

#include "stdafx.h"
#include <vtkVersion.h>
#include <vtkSmartPointer.h>
#include <vtkCellArray.h>
#include <vtkCellData.h>
#include <vtkDoubleArray.h>
#include <vtkPoints.h>
#include <vtkPolyLine.h>
#include <vtkPolyData.h>
#include <vtkPolyDataMapper.h>
#include <vtkActor.h>
#include <vtkRenderWindow.h>
#include <vtkRenderer.h>
#include <vtkRenderWindowInteractor.h>
#include "vtkAutoInit.h"   
VTK_MODULE_INIT(vtkRenderingOpenGL2); // VTK was built with vtkRenderingOpenGL2  
VTK_MODULE_INIT(vtkInteractionStyle);


int main(int, char *[])
{
    // Create five points.
    double origin[3] = { 0.0, 0.0, 0.0 };
    double p0[3] = { 1.0, 0.0, 0.0 };
    double p1[3] = { 0.0, 1.0, 0.0 };
    double p2[3] = { 0.0, 1.0, 2.0 };
    double p3[3] = { 1.0, 2.0, 3.0 };

    // Create a vtkPoints object and store the points in it
    vtkSmartPointer<vtkPoints> points =
        vtkSmartPointer<vtkPoints>::New();
    points->InsertNextPoint(origin);
    points->InsertNextPoint(p0);
    points->InsertNextPoint(p1);
    points->InsertNextPoint(p2);
    points->InsertNextPoint(p3);

    vtkSmartPointer<vtkPolyLine> polyLine =
        vtkSmartPointer<vtkPolyLine>::New();
    polyLine->GetPointIds()->SetNumberOfIds(5);
    for (unsigned int i = 0; i < 5; i++)
    {
        polyLine->GetPointIds()->SetId(i, i);
    }

    // Create a cell array to store the lines in and add the lines to it
    vtkSmartPointer<vtkCellArray> cells =
        vtkSmartPointer<vtkCellArray>::New();
    cells->InsertNextCell(polyLine);

    // Create a polydata to store everything in
    vtkSmartPointer<vtkPolyData> polyData =
        vtkSmartPointer<vtkPolyData>::New();

    // Add the points to the dataset
    polyData->SetPoints(points);

    // Add the lines to the dataset
    polyData->SetLines(cells);

    // Setup actor and mapper
    vtkSmartPointer<vtkPolyDataMapper> mapper =
        vtkSmartPointer<vtkPolyDataMapper>::New();
#if VTK_MAJOR_VERSION <= 5
    mapper->SetInput(polyData);
#else
    mapper->SetInputData(polyData);
#endif

    vtkSmartPointer<vtkActor> actor =
        vtkSmartPointer<vtkActor>::New();
    actor->SetMapper(mapper);

    // Setup render window, renderer, and interactor
    vtkSmartPointer<vtkRenderer> renderer =
        vtkSmartPointer<vtkRenderer>::New();
    vtkSmartPointer<vtkRenderWindow> renderWindow =
        vtkSmartPointer<vtkRenderWindow>::New();
    renderWindow->AddRenderer(renderer);
    vtkSmartPointer<vtkRenderWindowInteractor> renderWindowInteractor =
        vtkSmartPointer<vtkRenderWindowInteractor>::New();
    renderWindowInteractor->SetRenderWindow(renderWindow);
    renderer->AddActor(actor);

    renderWindow->Render();
    renderWindowInteractor->Start();

    return EXIT_SUCCESS;
}
View Code

 

8.3 >_<

 不会C++  QAAAQQQ

 VTK读图显示图的两种方式

8.4 >_<

Qt 子区域 和 子窗口

天很蓝,我很菜 QAAAQQQ

Qt 建立连接

 1 #include "Qtdemo.h"
 2 #include <QtWidgets/QApplication>
 3 #include <QPushButton>
 4 
 5 int main(int argc, char *argv[])
 6 {
 7     QApplication app(argc, argv);
 8     //Qtdemo w;
 9     //w.show();
10 
11     QPushButton *button = new QPushButton("Quit");
12     QObject::connect(button, SIGNAL(clicked()), &app, SLOT(quit()));
13 
14     button->show();
15 
16     return app.exec();
17 }
View Code

 窗口部件的布局

 1 #include "Qtdemo.h"
 2 #include <QtWidgets/QApplication>
 3 #include <QPushButton>
 4 #include <QHBoxLayout>
 5 #include <QSlider>
 6 #include <QSpinBox>
 7 
 8 int main(int argc, char *argv[])
 9 {
10     QApplication app(argc, argv);
11 
12     QWidget *window = new QWidget;
13     window->setWindowTitle("Enter Your Age");
14 
15     QSpinBox *spinBox = new QSpinBox;
16     QSlider  *slider = new QSlider(Qt::Horizontal);
17     spinBox->setRange(0, 130);
18 
19     QObject::connect(spinBox, SIGNAL(valueChanged(int)), slider, SLOT(setValue(int)));
20 
21     QObject::connect(slider, SIGNAL(valueChanged(int)), spinBox, SLOT(setValue(int)));
22 
23     spinBox->setValue(35);
24 
25     QHBoxLayout *layout = new QHBoxLayout;
26     layout->addWidget(spinBox);
27     layout->addWidget(slider);
28     window->setLayout(layout);
29 
30     window->show();
31 
32     return app.exec();
33 }
View Code

 8.5 >_<

 菜醒 ... QAAAAQQQ

新建一个子窗口

void PVSTGUI::on_Format_clicked()
{
    QWidget* newsubwin = new QWidget;
    newsubwin->setWindowTitle(QString::fromLocal8Bit("新建子窗口!"));
    QMdiSubWindow* subwin = ui.mdiArea->addSubWindow(newsubwin);
    subwin->show();
    subwin->resize(QSize(512,512));
    QList<QMdiSubWindow*> sublist = ui.mdiArea->subWindowList();
    
    ui.mdiArea->tileSubWindows();

    QVTKWidget* qvtkwidget = new QVTKWidget;
    subwin->setWidget(qvtkwidget);


}
View Code

 8.6 >_<

备份一下代码..

#pragma once
#pragma once

#include <QtWidgets/QMainWindow>
#include "ui_PVST.h"
#include <QVTKWidget.h>
#include <qmdisubwindow.h>
#include <qmdiarea.h>

//vtk库
#include <vtkAutoInit.h>
VTK_MODULE_INIT(vtkRenderingOpenGL2);
VTK_MODULE_INIT(vtkInteractionStyle);
VTK_MODULE_INIT(vtkRenderingFreeType);
#include <qdebug.h>
#include <vtkSetGet.h>
#include <vtkObjectFactory.h>
#include <vtkProperty.h>
#include <vtkJPEGReader.h>
#include <vtkDICOMImageReader.h>
#include <vtkImageViewer2.h>
#include <vtkSmartPointer.h>
#include <vtkRenderer.h>
#include <vtkRenderWindow.h>
#include <vtkRenderWindowInteractor.h>
#include <vtkImageActor.h>
#include <vtkImageData.h>
#include <vtkInteractorStyleTrackballCamera.h>
#include <vtkPicker.h>
#include <qfiledialog.h>

class SplitScreen : public QMainWindow
{
    Q_OBJECT

public:
    SplitScreen(QWidget *parent = Q_NULLPTR);
    void SetmidArea(QMdiArea *mdiArea);

private slots:
    void on_AddSubWin_clicked();

    void on_LayoutWin_clicked();

    void on_SizeWin_clicked();

private:
    //Ui::PVSTClass ui;
    QMdiArea * _mdiarea;

};
View Code
#include "SplitScreen.h"

#include "MouseStyle.h"
#include <qmdisubwindow.h>
#include <QVTKWidget.h>
#include <qmdiarea.h>
#include <qdebug.h>

SplitScreen::SplitScreen(QWidget *parent)
    : QMainWindow(parent)
{
    //qDebug()<< 111;
    //ui.setupUi(this);
}

void SplitScreen::on_AddSubWin_clicked()
{
    QWidget* newsubwin = new QWidget;//新建一个子窗口
    newsubwin->setWindowTitle(QString::fromLocal8Bit("新建子窗口!")); // 给子窗口改名字
    QMdiSubWindow* subwin = _mdiarea->addSubWindow(newsubwin);// 把子窗口加到mdiArea中
    subwin->show();// 显示子窗口
    subwin->resize(QSize(512, 512)); //子窗口大小设置
    QList<QMdiSubWindow*> sublist = _mdiarea->subWindowList(); // 获得mdiArea的所有子窗口

    //_mdiarea->tileSubWindows(); // 自动排列mdiArea的所有子窗口

    QVTKWidget* qvtkwidget = new QVTKWidget;// 新建一个QVTKWidget 用于显示图像
    subwin->setWidget(qvtkwidget); // 将新建立的QVTKWidget加到刚建立的子窗口
}

void SplitScreen::on_LayoutWin_clicked()
{
    _mdiarea->tileSubWindows(); // 自动排列mdiArea的所有子窗口

}

void SplitScreen::on_SizeWin_clicked()
{
    for (int i = 1; i <= 12; i++)
    {
        QWidget* newsubwin = new QWidget;
        newsubwin->setWindowTitle(QString::fromLocal8Bit("新建子窗口!")); 
        QMdiSubWindow* subwin = _mdiarea->addSubWindow(newsubwin);
        subwin->show();
        subwin->resize(QSize(512, 512)); 
        QList<QMdiSubWindow*> sublist = _mdiarea->subWindowList(); 
        QVTKWidget* qvtkwidget = new QVTKWidget;
        subwin->setWidget(qvtkwidget);
    }
    _mdiarea->tileSubWindows();     
}

void SplitScreen::SetmidArea(QMdiArea *object)
{
    _mdiarea = object;
}
View Code

 

Qt 中的QObject

Qt 实现滚动条

 8.7 >_<

Qt控件

Qt文档

花式出bug喔 =3=

类里面有 mdiArea这个类,但是报错 说 mdiArea不属于这个类,因为 在 ui 里面没有加 mdiArea这个控件

添加子窗口个数较多的时候会出现显示混乱,因为在窗口还没有设置完的时候,就show() 子窗口了

添加子窗口加排版

void SplitScreen::AddSubWin()
{
        QWidget* newsubwin = new QWidget;//新建一个子窗口
        newsubwin->setWindowTitle(QString::fromLocal8Bit("新建子窗口!")); // 给子窗口改名字
        QMdiSubWindow* subwin = _mdiarea->addSubWindow(newsubwin);// 把子窗口加到mdiArea中
        QList<QMdiSubWindow*> sublist = _mdiarea->subWindowList(); // 获得mdiArea的所有子窗口
        QSize _mdiAreaSize = _mdiarea->size();
        double w = _mdiAreaSize.width();
        double h = 100;
        int NumberOfSubWin = sublist.size();
        
        for (int i = 0; i < NumberOfSubWin; i++)
        {
                sublist[i]->setGeometry(0, h*i, w, h);
        }
        
        //subwin->show();// 显示子窗口
        //subwin->activateWindow();

        //_mdiarea->tileSubWindows(); // 自动排列mdiArea的所有子窗口

        QVTKWidget* qvtkwidget = new QVTKWidget;// 新建一个QVTKWidget 用于显示图像
        subwin->setWidget(qvtkwidget); // 将新建立的QVTKWidget加到刚建立的子窗口
        subwin->show();// 显示子窗口
}
View Code

 

图片的排列显示原来和这个数列有关qaq 感谢oeis!

 

8.8 >_<

今天 是 吉利 的 日子耶 !

第一次提交有成绩,虽然还是菜菜的,但是还是挺开心的>< 撒花 !

这个版本的代码输出格式不太对,第一次交没成绩,后来写c++调整调整~~~~qaaaaqqq

# -*- coding:UTF-8 -*-
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import tensorflow as tf
import scipy.interpolate as itp
from scipy import interpolate
import numpy as np
import pylab as pl
from sklearn import ensemble, cross_validation
from sklearn.externals import joblib
import os
import os.path

# 读入文件,遍历文件夹
rootdir = 'C:\\Users\\j\\Desktop\\trans\\data\\train'

F_ = open('C:\\Users\\j\\Desktop\\ansv1.txt',"w+")

for parent,dirnames,filenames in os.walk(rootdir):
    for filename in filenames:
        f = open('C:\\Users\\j\\Desktop\\trans\\data\\train\\' + filename)
        line = f.readline()

        # 读入原始数据
        X = []
        Y = []
        while line:
            x = ''
            pos = 0
            for i in range(0,line.__len__()):
                if (line[i] == ' '):
                    pos = i
                    break;
                x = x + line[i]

            x = int(x)
            X.append(x)

            y = ''
            for i in range(pos+1,line.__len__()):
                y = y + line[i]
            y = float(y)
            Y.append(y)
            #print (x,y)
            line = f.readline()

        # 补全训练集数据
        use = [[0 for i in range(1)]for j in range(24 * 30 * 100)]
        for i in range(0,X.__len__()):
            use[X[i]][0] = Y[i]

        # 求出各个时刻众数
        count = [[0 for i in range(1)]for j in range(24 * 30 * 2)]
        F = open('C:\\Users\\j\\Desktop\\zs\\' + filename)
        Line = F.readline()

        while Line:
            x = ''
            pos = 0
            for i in range(0,Line.__len__()):
                if (Line[i] == ' '):
                    pos = i
                    break;
                x = x + Line[i]

            x = int(x)

            y = ''
            for i in range(pos+1,Line.__len__()):
                y = y + Line[i]
            y = float(y)
            Line = F.readline()

            count[x][0] = y;

        x_use = []
        y_use = []

        # 补全训练集数据
        for i in range(0,24 * 30 * 92):
            x_use.append(i)
            if (use[i][0] == 0):
                id = i % 720
                y_use.append(count[id][0])
            else:
                #print (use[i][0])
                y_use.append(use[i][0])

        # 训练
        trainx = [[0 for i in range(30)]for j in range(24 * 30 * 95)]
        trainy = [[0 for i in range(1)]for j in range(24 * 30 * 95)]
        testx = [[0 for i in range(30)]for j in range(24 * 30 * 95)]
        x_debug = []
        y_debug = []

        for i in range(30,24 * 30 * 92):
            id = x_use[i] / 720 % 7 + 2
            trainx[i][0] = id;
            x_debug.append(i)
            y_debug.append(y_use[i])
            for j in range(1,30):
                #print (i,j,i-(30-j))
                trainx[i][j] = y_use[i - (30 - j)]
                trainy[i][0] = y_use[i]

        params = {'n_estimators': 500, 'max_depth': 4, 'min_samples_split': 1,
           'learning_rate': 0.01, 'loss': 'ls'}
        clf = ensemble.GradientBoostingRegressor(**params)

        clf.fit(trainx,trainy)


        # 组成三十天的测试集
        # 读入测试集
        ff = open('C:\\Users\\j\\Desktop\\trans\\data\\test\\' + filename)
        lline = ff.readline()

        X_test = []
        Y_test = []

        while lline:
            x = ''
            pos = 0
            for i in range(0,lline.__len__()):
                if (lline[i] == ' '):
                    pos = i
                    break;
                x = x + lline[i]

            x = int(x)
            X_test.append(x)

            y = ''
            for i in range(pos+1,lline.__len__()):
                y = y + lline[i]

            y = float(y)
            Y_test.append(y)

            lline = ff.readline()

        f.close()
        # 补全测试集
        use_t = [[0 for i in range(1)]for j in range(24 * 30 * 50)]
        for i in range(0,X_test.__len__()):
            #print (i,X_test.__len__(),Y_test.__len__(),X_test[i],use_t.__len__())
            use[X_test[i]][0] = Y_test[i]

        x_use_t = []
        y_use_t = []

        for i in range(0,24 * 30 *30):
            x_use_t.append(i)
            if (use_t[i][0] == 0):
                id = i % 720
                y_use_t.append(count[id][0])
            else:
                #print (use[i][0])
                y_use_t.append(use_t[i][0])


        for day in range(1,31):
            st = (day - 1) * 720
            testx = [[0 for i in range(30)]for j in range(60)]
            for i in range(st + 180,st + 240):
                for j in range(0,30):
                    testx[i-(st+180)][j] = y_use_t[i - (30 - j)]

        #print (testx)

            pre = clf.predict(testx)
            x_ = [[0 for i in range(1)]for j in range(60)]
            for j in range(st + 180,st + 240):
                x_[j - (st + 180)][0] = j

            for j in range(30,60):
                date = '2016-06-'
                if (i >= 10):
                    date = date + str(day)
                else:
                    date = date + '0' + str(day)
                tl = (j - 30) * 2
                tr = (j - 29) * 2
                if (tl >= 10):
                    timel = '08:' + str(tl) + ':00'
                else:
                    timel = '08:' + '0' + str(tl) + ':00'

                if (tr >= 10):
                    timer = '08:' + str(tr) + ':00'
                else:
                    timer = '08:' + '0' + str(tr) + ':00'

                time = '[' + date + ' ' + date + ' ' + timel + ',' + date + ' ' + timer + ')'

                filename_ = filename[:filename.__len__()-4]

                print (filename_,'#',date,'#',time,'#',pre[j])

                F_.write(filename_)
                F_.write('#')
                F_.write(date)
                F_.write('#')
                F_.write(time)
                F_.write('#')
                F_.write(str(pre[j]) + '\n')
        '''
        pl.figure()
        pl.plot(x_,pre,'ro')
        pl.show()
        pl.close()
        '''
View Code

 

------ 萌萌哒的昏割线 -----

排列子窗口

 1 void SplitScreen::LayoutWin()
 2 {
 3     // 打表 预处理
 4     int t[] = { 1,2,7,10,15,19,23,27, 31, 36, 40, 43, 47, 52, 55, 60, 63, 68, 73, 76, 81, 83, 88, 92, 96, 100, 105, 109, 113, 117, 121, 126, 128, 133, 138, 141, 146, 149, 154, 158, 162, 166, 169, 174, 178, 182, 186, 191, 194, 199, 202, 207, 212, 214, 219, 222, 227, 231, 235, 239, 244, 248, 252, 255, 259, 264, 267, 272, 277, 280, 285, 288, 293, 297, 300 };
 5     int st[105];
 6     memset(st, 0, sizeof(st));
 7     st[0] = t[0];
 8     for (int i = 1; i <= 74; i++) st[i] = st[i - 1] + t[i];
 9     QList<QMdiSubWindow*> sublist = _mdiarea->subWindowList();
10     QSize _mdiAreaSize = _mdiarea->size();
11     int NumberOfSubWin = sublist.size();
12     int pos = lower_bound(st + 1, st + 75, NumberOfSubWin) - st;
13 
14     int n, m, mod;
15     for (int j = NumberOfSubWin;; j++)
16     {
17         if (j%pos == 0)
18         {
19             m = j / pos;
20             break;
21         }
22     }
23 
24     n = NumberOfSubWin / m;
25     mod = NumberOfSubWin % m;
26 
27     double W = _mdiAreaSize.width();
28     double H = 500;
29     int aw = W / m, h;
30     if (mod == 0) h = H / n;
31     else h = H / (n + 1);
32 
33     for (int i = 1; i <= n; i++)
34     {
35         for (int j = 1; j <= m; j++)
36         {
37             int id = (i - 1) * m + j - 1;
38             int x = (j - 1) * aw;
39             int y = h * (i - 1);
40             //qDebug() << "zuo biao";
41             //qDebug() << id << " " << x << " " << y << aw << " " << h << "\n";
42             sublist[id]->setGeometry(x, y, aw, h); // 给每一个子窗口设置位置长宽
43         }
44     }
45 
46     if (mod != 0)
47     {
48         int bw = W / mod;
49         for (int i = 1; i <= mod; i++)
50         {
51             int id = n * m + i - 1;
52             int x = (i - 1) * bw;
53             int y = n * h;
54             sublist[id]->setGeometry(x, y, bw, h); // 给每一个子窗口设置位置长宽
55         }
56     }    
57 }
View Code

 

Qt常用类

踩坑

将某个控件和写的类连接起来的时候,函数名 是 on_xxx_clicked(),xxx是控件名,不能自己随便取

添加滚动条

// 添加纵向滚动条
    //_mdiarea->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
    //_mdiarea->verticalScrollBar()->setVisible(true);

    //添加横向滚动条
    //_mdiarea->setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded);
    //_mdiarea->horizontalScrollBar()->setVisible(false);
View Code

 

8.9 >_<

如果某段时间 一直听某首歌的话...之后再听会再想起那段时光>< 蟹蟹miku ! miku 快要十周岁了呢 qwq

--------- 昏割线 -----------

对 vs 里面 git 的操作还是很不了解阿..qvq

 控件颜色设置

找了一个下午,设置窗体的属性,原来这个东西叫标题栏呀^ ^

看了窗体的设置(据说和css差不多,实验了一个很漂亮的蓝色 和圆形半角弧度的框框 ><)

然后标题栏据目前搜到的东西,只能有自带的函数可以改变样式的,但是颜色,icon的设置,长宽这些都要重写类自己绘制

自定义标题栏1

自定义标题栏2

 

8.10 >_<

Qt的坐标系统

 还很不完善的标题栏,但是 1.0 版本 还是想纪念一下 嗷嗷 owo

#pragma once

#include <QtWidgets/QMainWindow>
#include "ui_Widget.h"
#include <QWidget>
#include <QPainter>
#include <QMdiArea>
#include <QLabel>

class Widget : public QMainWindow
{
    Q_OBJECT

public:
    Widget(QWidget *parent = Q_NULLPTR);

    void init();

private slots:
    void on_m_pMinimizeButton_clicked();
    void on_m_pMaximizeButton_clicked();
    void on_m_pCloseButton_clicked();

protected:
    void paintEvent(QPaintEvent *);

private:
    Ui::WidgetClass ui;
    QMdiArea _mdiarea;

private:
    QPushButton *m_pMinimizeButton;
    QPushButton *m_pMaximizeButton;
    QPushButton *m_pCloseButton;
};
View Code
#include "Widget.h"
#include <qdebug.h>
#include <qmdisubwindow.h>

Widget::Widget(QWidget *parent)
    : QMainWindow(parent)
{
    ui.setupUi(this);

    m_pMinimizeButton = ui.m_pMinimizeButton;
    m_pMaximizeButton = ui.m_pMaximizeButton;
    m_pCloseButton = ui.m_pCloseButton;

    QSize _Size = this->size();
    double w = _Size.width();
    double h = _Size.height();


    connect(m_pMinimizeButton, SIGNAL(clicked(bool)), this, SLOT(onClicked()));
    connect(m_pMaximizeButton, SIGNAL(clicked(bool)), this, SLOT(onClicked()));
    connect(m_pCloseButton, SIGNAL(clicked(bool)), this, SLOT(onClicked()));

}

void Widget::paintEvent(QPaintEvent *) {
    QPainter painter(this);
    painter.setPen(Qt::red); 
    QSize _Size = this->size();

    double _x = this->x();
    double _y = this->y();
    double _w = _Size.width();
    double _h = _Size.height();

    //qDebug() << _x << "\n" << _y << "\n" << _w << "\n" << _h << "\n";

    // 这个函数在每一次窗口被show的时候调用,此时用相对大小绘制标题栏
    painter.setBrush(Qt::red);
    painter.drawRect(0,0,_w,20); 
    m_pMinimizeButton->setGeometry(_w - 80, 0, 20, 20);
    m_pMaximizeButton->setGeometry(_w - 50, 0, 20, 20);
    m_pCloseButton->setGeometry(_w - 20, 0, 20, 20);

}

void Widget::init()
{
    this->setGeometry(100, 100, 500, 800);
}

void Widget::on_m_pMinimizeButton_clicked()
{
    QWidget *pWindow = this->window();
    pWindow->showMinimized();
}

void Widget::on_m_pMaximizeButton_clicked()
{
    QWidget *pWindow = this->window();
    if (pWindow->isMaximized())
    {
        pWindow->showNormal();
    }
    else
    {
        pWindow->showMaximized();
    }
}

void Widget::on_m_pCloseButton_clicked()
{
    QWidget *pWindow = this->window();
    pWindow->close();
}
View Code

 1.1 版本,调整了标题栏 和 icon 图标

有个奇怪的地方是,QPushButton 没办法设置按钮颜色,后来换成 QToolButton 了,不资到为什么 qvq

#pragma once

#include <QtWidgets/QMainWindow>
#include "ui_Widget.h"
#include <QWidget>
#include <QPainter>
#include <QMdiArea>
#include <QLabel>

class Widget : public QMainWindow
{
    Q_OBJECT

public:
    Widget(QWidget *parent = Q_NULLPTR);

    void init();

private slots:
    void on_m_pMinimizeButton_clicked();
    void on_m_pMaximizeButton_clicked();
    void on_m_pCloseButton_clicked();

protected:
    void paintEvent(QPaintEvent *);

private:
    Ui::WidgetClass ui;
    QMdiArea _mdiarea;
    QToolButton *m_pMinimizeButton;
    QToolButton *m_pMaximizeButton;
    QToolButton *m_pCloseButton;
    QPushButton *Test;
    QToolButton *Testt;
};
View Code
#include "Widget.h"
#include <qdebug.h>
#include <qmdisubwindow.h>
#include <QStyle>
#include <QColor>

Widget::Widget(QWidget *parent)
    : QMainWindow(parent)
{
    ui.setupUi(this);

    m_pMinimizeButton = ui.m_pMinimizeButton;
    m_pMaximizeButton = ui.m_pMaximizeButton;
    m_pCloseButton = ui.m_pCloseButton;
    Test = ui.Test;
    Testt = ui.Testt;

    Test->setStyleSheet(QLatin1String("QToolButton\n"
        "{\n"
        "background-color:red;\n"
        "}"));

    QSize _Size = this->size();
    double w = _Size.width();
    double h = _Size.height();

    connect(m_pMinimizeButton, SIGNAL(clicked(bool)), this, SLOT(onClicked()));
    connect(m_pMaximizeButton, SIGNAL(clicked(bool)), this, SLOT(onClicked()));
    connect(m_pCloseButton, SIGNAL(clicked(bool)), this, SLOT(onClicked()));

}

void Widget::paintEvent(QPaintEvent *) {
    QPainter painter(this);
    painter.setPen(QColor(70, 50, 50));
    QSize _Size = this->size();

    double _x = this->x();
    double _y = this->y();
    double _w = _Size.width();
    double _h = _Size.height();

    //qDebug() << _x << "\n" << _y << "\n" << _w << "\n" << _h << "\n";

    // 设计icon样式
    QPixmap minPix = style()->standardPixmap(QStyle::SP_TitleBarMinButton);
    QPixmap closePix = style()->standardPixmap(QStyle::SP_TitleBarCloseButton);
    QPixmap maxPix = style()->standardPixmap(QStyle::SP_TitleBarMaxButton);

    m_pMinimizeButton->setIcon(minPix);
    m_pMaximizeButton->setIcon(maxPix);
    m_pCloseButton->setIcon(closePix);
    Testt->setIcon(closePix);

    // 设计icon背景色
    m_pMinimizeButton->setStyleSheet(QLatin1String("QToolButton\n"
        "{\n"
        "background-color:rgb(70,50,50);\n"
        "}"));

    m_pMaximizeButton->setStyleSheet(QLatin1String("QToolButton\n"
        "{\n"
        "background-color:rgb(70,50,50);\n"
        "}"));

    m_pCloseButton->setStyleSheet(QLatin1String("QToolButton\n"
        "{\n"
        "background-color:rgb(70,50,50);\n"
        "}"));

    Testt->setStyleSheet(QLatin1String("QToolButton\n"
        "{\n"
        "background-color:rgb(70,50,50);\n"
        "}"));

    // 这个函数在每一次窗口被show的时候调用,此时用相对大小绘制标题栏
    painter.setBrush(QColor(70,50,50));
    painter.drawRect(0,0,_w,20); 

    m_pMinimizeButton->setGeometry(_w - 80, 0, 20, 20);

    
    m_pMaximizeButton->setGeometry(_w - 50, 0, 20, 20);
    
    m_pCloseButton->setGeometry(_w - 20, 0, 20, 20);

}

void Widget::init()
{
    this->setGeometry(100, 100, 500, 800);
}

void Widget::on_m_pMinimizeButton_clicked()
{
    QWidget *pWindow = this->window();
    pWindow->showMinimized();
}

void Widget::on_m_pMaximizeButton_clicked()
{
    QWidget *pWindow = this->window();
    if (pWindow->isMaximized())
    {
        pWindow->showNormal();
    }
    else
    {
        pWindow->showMaximized();
    }
}

void Widget::on_m_pCloseButton_clicked()
{
    QWidget *pWindow = this->window();
    pWindow->close();
}
View Code

 

8.11 >_<

如果不把按钮的背景色设置成透明,会有浮雕的效果qaq

然后 把这个绘制标题栏的类 和他们的窗体的类结合起来之后,出 bug bug bug bug 咯 !

8.12 >_<

第一次参加 纪念一下>< 

完全xjb搞呀...ending !..还有很多要学的好好加油呀 ovo !

话说 17 年的数据更友好呀,什么都没干mape就下降 owo !

 

 

8.13 >_<

不显示button的bug终于知道为什么了

第一层 是 mainwindow ,第二层 是subwindow ,centralwidget (并列关系)

bug 的逻辑是在新建的subwindow 里面 还添加了 centralwidget 作为容器

学到一点大概是,怎么xjb改都不对的时候,可以去查一下这些类的构成 owo 

 

不过又出现了新的bug.... 本地点击按钮 没有响应了..(很迷 ---- update 2017.8.15 所以测试的时候没有解决的问题到现在整合起来又蹦粗来了嗷qaq

Qt中文参考文档

 

8.14 >_<

不算 bug ,窗口显示图片 的 自适应 问题  会有白边 不好看

调bug 效率很低... 没有经验...完全 xjb 试 qaaqq

 

8.15 >_<

八月过半

QList的用法

我好菜阿...........qaaaaqqaaaq

 qss

还是不知道在qss里面怎么设置 控件的位置...还有一个疑惑的地方是,设置好一个控件后,它的位置就是自动根据当前窗体的相对大小来定的了么

调标题栏的时候遇到蜜汁坐标系...同一个点的纵坐标 有两个...

 

8.16 >_<

 信号与槽机制

VTK体绘制

三维重建的一个例子,不懂的是,颜色,梯度,不透明度的区间要怎么去设置(感觉和图像的灰度有关...但要区分出不同区域..似乎又要分割..? 不会qaqaaaq

//#include "PVSTGUI.h"
#include <QtWidgets/QApplication>

#include "vtkRenderer.h"
#include "vtkRenderWindow.h"
#include "vtkRenderWindowInteractor.h"
#include "vtkActor.h"
#include "vtkSmartPointer.h"
#include "vtkProperty.h"
#include "vtkCamera.h"
#include "vtkDICOMImageReader.h"
#include "vtkImageCast.h"
#include "vtkPiecewiseFunction.h"
#include "vtkColorTransferFunction.h"
#include "vtkVolumeProperty.h"
#include "vtkVolumeRayCastCompositeFunction.h"
#include "vtkVolumeRayCastMapper.h"
#include "vtkVolume.h"

#include <vtkAutoInit.h>



int main(int argc, char *argv[])
{
    VTK_MODULE_INIT(vtkRenderingVolumeOpenGL2);
    vtkSmartPointer<vtkDICOMImageReader>dicomImagereader = vtkSmartPointer<vtkDICOMImageReader>::New();
    dicomImagereader->SetDirectoryName("‪C:\\Users\\lab\\Desktop\\1.3.6.1.4.1.14519.5.2.1.7695.2311.101194443955813969344566251700");
    dicomImagereader->SetDataByteOrderToLittleEndian();

    vtkSmartPointer<vtkImageCast>readerImageCast = vtkSmartPointer<vtkImageCast>::New();
    readerImageCast->SetInputConnection(dicomImagereader->GetOutputPort());
    readerImageCast->SetOutputScalarTypeToUnsignedShort();
    readerImageCast->Update();

    // 设置透明度
    vtkSmartPointer<vtkPiecewiseFunction>opactiyTransferFunction = vtkSmartPointer<vtkPiecewiseFunction>::New();
    opactiyTransferFunction->AddPoint(120, 0.0);
    opactiyTransferFunction->AddPoint(250, 1.0);
    opactiyTransferFunction->AddPoint(520, 1.0);
    opactiyTransferFunction->AddPoint(650, 0.0);

    //设置颜色
    vtkSmartPointer<vtkColorTransferFunction>colorTransferFunction = vtkSmartPointer<vtkColorTransferFunction>::New();
    colorTransferFunction->AddRGBPoint(120, 255 / 255.0, 98 / 255.0, 98 / 255.0);
    colorTransferFunction->AddRGBPoint(250, 255 / 255.0, 255 / 255.0, 180 / 255.0);
    colorTransferFunction->AddRGBPoint(520, 1.0, 1.0, 1.0);
    colorTransferFunction->AddRGBPoint(650, 1.0, 1.0, 1.0);

    //设置梯度
    vtkSmartPointer<vtkPiecewiseFunction>gradientTransferFunction = vtkSmartPointer<vtkPiecewiseFunction>::New();
    gradientTransferFunction->AddPoint(120, 2.0);
    gradientTransferFunction->AddPoint(250, 2.0);
    gradientTransferFunction->AddPoint(520, 0.1);
    gradientTransferFunction->AddPoint(650, 0.1);

    vtkSmartPointer<vtkVolumeProperty>volumeProperty = vtkSmartPointer<vtkVolumeProperty>::New();
    volumeProperty->SetColor(colorTransferFunction);
    volumeProperty->SetScalarOpacity(opactiyTransferFunction);
    volumeProperty->SetGradientOpacity(gradientTransferFunction);
    volumeProperty->ShadeOn();//阴影
                              //volumeProperty->SetInterpolationTypeToLinear();//直线与样条插值之间逐发函数
    volumeProperty->SetAmbient(0.2);//环境光系数
    volumeProperty->SetDiffuse(0.9);//漫反射
    volumeProperty->SetSpecular(0.2);//高光系数
    volumeProperty->SetSpecularPower(10);//高光强度

    vtkSmartPointer<vtkVolumeRayCastCompositeFunction>compositeRaycastFunction = vtkSmartPointer<vtkVolumeRayCastCompositeFunction>::New();

    vtkSmartPointer<vtkVolumeRayCastMapper>volumeMapper = vtkSmartPointer<vtkVolumeRayCastMapper>::New();
    volumeMapper->SetVolumeRayCastFunction(compositeRaycastFunction);//载入体绘制方法
    volumeMapper->SetInputConnection(readerImageCast->GetOutputPort());
    /*fixedPointVolumeMapper=vtkFixedPointVolumeRayCastMapper::New();
    fixedPointVolumeMapper->SetInput(dicomImagereader->GetOutput());*/

    vtkSmartPointer<vtkVolume>volume = vtkSmartPointer<vtkVolume>::New();
    volume->SetMapper(volumeMapper);
    volume->SetProperty(volumeProperty);//设置体属性

    vtkSmartPointer<vtkRenderer>ren1 = vtkSmartPointer<vtkRenderer>::New();
    ren1->AddVolume(volume);
    ren1->SetBackground(1, 1, 1);

    vtkSmartPointer<vtkRenderWindow>renWin = vtkSmartPointer<vtkRenderWindow>::New();
    renWin->AddRenderer(ren1);
    renWin->SetSize(800, 800);

    vtkSmartPointer<vtkRenderWindowInteractor>iren = vtkSmartPointer<vtkRenderWindowInteractor>::New();
    iren->SetRenderWindow(renWin);

    renWin->Render();
    iren->Start();
    /*
    QApplication a(argc, argv);
    PVSTGUI w;
    w.show();
    return a.exec();
    */
}
View Code

 8.17 >_<

瞎调参...重建效果非常不好 qaqqaq

 

8.18 >_<

发现一个重建效果色彩很棒(偏艺术一些而不是还原人体器官组织~)的软件 Aliza >o<

 

虾条两天的参,但是切片之间看起来很粗糙断层很明显..用了均值滤波...但是只是内部骨骼肌肉变得更加光滑外面的皮肤还是断层厉害..

还有感觉rgb颜色对照表的颜色和实际vtk显示出来的颜色色差很大....有时候肌肉皮肤弄出来的颜色很吓人..

//#include "PVSTGUI.h"
#include <QtWidgets/QApplication>

#include "vtkRenderer.h"
#include "vtkRenderWindow.h"
#include "vtkRenderWindowInteractor.h"
#include "vtkActor.h"
#include "vtkSmartPointer.h"
#include "vtkProperty.h"
#include "vtkCamera.h"
#include "vtkDICOMImageReader.h"
#include "vtkImageCast.h"
#include "vtkPiecewiseFunction.h"
#include "vtkColorTransferFunction.h"
#include "vtkVolumeProperty.h"
#include "vtkVolumeRayCastCompositeFunction.h"
#include "vtkVolumeRayCastMapper.h"
#include "vtkVolume.h"
#include <vtkImageGaussianSmooth.h> 
#include <vtkImageActor.h>
#include <vtkImageConvolve.h>
#include <vtkInteractorStyleImage.h>
#include <vtkAutoInit.h>
#include <cstdio>
#include <cstring>
#include <ctime>
#include <iostream>
#include <algorithm>
using namespace std;

void solve(double x)
{
    VTK_MODULE_INIT(vtkRenderingVolumeOpenGL2);
    vtkSmartPointer<vtkDICOMImageReader>dicomImagereader = vtkSmartPointer<vtkDICOMImageReader>::New();
    dicomImagereader->SetDirectoryName("C:\\Users\\lab\\Desktop\\1.3.6.1.4.1.14519.5.2.1.7695.2311.101194443955813969344566251700");
    dicomImagereader->SetDataByteOrderToLittleEndian();

    vtkSmartPointer<vtkImageCast>readerImageCast = vtkSmartPointer<vtkImageCast>::New();
    readerImageCast->SetInputConnection(dicomImagereader->GetOutputPort());
    readerImageCast->SetOutputScalarTypeToUnsignedShort();
    readerImageCast->Update();

    // ---- for test ---------------------------------------------------------
    vtkSmartPointer<vtkImageConvolve> convolveFilter =
        vtkSmartPointer<vtkImageConvolve>::New();

    convolveFilter->SetInputConnection(readerImageCast->GetOutputPort());
    double kernel[25] = { 0.04,0.04,0.04,0.04,0.04,
        0.04,0.04,0.04,0.04,0.04,
        0.04,0.04,0.04,0.04,0.04,
        0.04,0.04,0.04,0.04,0.04,
        0.04,0.04,0.04,0.04,0.04 };

    convolveFilter->SetKernel5x5(kernel);
    convolveFilter->Update();
    vtkSmartPointer<vtkImageCast>convCastFilter =
        vtkSmartPointer<vtkImageCast>::New();
    convCastFilter->SetInputConnection(convolveFilter->GetOutputPort());
    convCastFilter->SetOutputScalarTypeToUnsignedChar();
    convCastFilter->Update();
    // ---- end test ----------------------------------------------------------------



    // 滤波
    vtkSmartPointer<vtkImageGaussianSmooth> gaussianSmoothFilter =
        vtkSmartPointer<vtkImageGaussianSmooth>::New();
    gaussianSmoothFilter->SetInputConnection(readerImageCast->GetOutputPort());
    gaussianSmoothFilter->SetDimensionality(3);
    gaussianSmoothFilter->SetRadiusFactor(5); //设置模板范围  
    gaussianSmoothFilter->SetStandardDeviation(3);//正态分布/高斯分布标准差  
    gaussianSmoothFilter->Update();

    vtkSmartPointer<vtkImageActor> smoothedActor =
        vtkSmartPointer<vtkImageActor>::New();
    smoothedActor->SetInputData(gaussianSmoothFilter->GetOutput());

    //smoothedActor->GetProperty()
    

//    double smoothedViewport[4] = { 0.5, 0.0, 1.0, 1.0 };

    vtkSmartPointer<vtkRenderer> gradientMagnitudeRenderer =
        vtkSmartPointer<vtkRenderer>::New();
//    gradientMagnitudeRenderer->SetViewport(smoothedViewport);
    gradientMagnitudeRenderer->AddActor(smoothedActor);
    gradientMagnitudeRenderer->ResetCamera();


    //不透明度传输函数
    vtkSmartPointer<vtkPiecewiseFunction>opactiyTransferFunction = vtkSmartPointer<vtkPiecewiseFunction>::New();
    /*
    opactiyTransferFunction->AddPoint(120, 0.0);
    opactiyTransferFunction->AddPoint(250, 1.0);
    opactiyTransferFunction->AddPoint(250, 1.0);
    opactiyTransferFunction->AddPoint(520, 1.0);
    opactiyTransferFunction->AddPoint(650, 0.0);
    */

    // ---- test begin --------
    opactiyTransferFunction->AddPoint(100, 0.0);
    opactiyTransferFunction->AddPoint(240, 1.0);
    opactiyTransferFunction->AddPoint(242, 0.0);
    opactiyTransferFunction->AddPoint(1495, 1.0);

    //opactiyTransferFunction->AddPoint(129, 1.0);
    //opactiyTransferFunction->AddPoint(240, 0.0);
    //opactiyTransferFunction->AddPoint(300, 1.0);
    //opactiyTransferFunction->AddPoint(300, 1.0);
    //opactiyTransferFunction->AddPoint(700, 1.0);
    //opactiyTransferFunction->AddPoint(900, 0.0);
    // ---- test end ----------


    //颜色传输函数
    vtkSmartPointer<vtkColorTransferFunction>colorTransferFunction = vtkSmartPointer<vtkColorTransferFunction>::New();
    //colorTransferFunction->AddRGBPoint(120, 255 / 255.0, 98 / 255.0, 98 / 255.0);
    //colorTransferFunction->AddRGBPoint(250, 255 / 255.0, 255 / 255.0, 180 / 255.0);
    //colorTransferFunction->AddRGBPoint(520, 1.0, 1.0, 1.0);
    //colorTransferFunction->AddRGBPoint(650, 1.0, 1.0, 1.0);

    colorTransferFunction->AddRGBPoint(100, 207 / 255.0, 147 / 255.0, 89 / 255.0);//黄色
    colorTransferFunction->AddRGBPoint(105, 255 / 255.0, 255 / 255.0, 255 / 255.0);//白色
    colorTransferFunction->AddRGBPoint(129, 255 / 255.0, 98 / 255.0, 98 / 255.0);//红色
    colorTransferFunction->AddRGBPoint(240, 205 / 255.0, 133 / 255.0, 63 / 255.0); //深黄色
    colorTransferFunction->AddRGBPoint(242, 255 / 255.0, 255 / 255.0, 255 / 255.0); //白色
    colorTransferFunction->AddRGBPoint(1495, 207 / 255.0, 147 / 255.0, 89 / 255.0); //黄色

    // ---- test begin ------
    //colorTransferFunction->AddRGBPoint(120, 255 / 255.0, 98 / 255.0, 98 / 255.0);
    //colorTransferFunction->AddRGBPoint(250, 255 / 255.0, 255 / 255.0, 180 / 255.0);
    //colorTransferFunction->AddRGBPoint(250, 1.0, 1.0, 1.0);
    //colorTransferFunction->AddRGBPoint(1500, 1.0, 0, 0);
    // ---- test end --------

    //梯度不透明度函数
    vtkSmartPointer<vtkPiecewiseFunction>gradientTransferFunction = vtkSmartPointer<vtkPiecewiseFunction>::New();
    gradientTransferFunction->AddPoint(120, 2.0);
    gradientTransferFunction->AddPoint(250, 2.0);
    gradientTransferFunction->AddPoint(520, 0.1);
    gradientTransferFunction->AddPoint(650, 0.1);


    vtkSmartPointer<vtkVolumeProperty>volumeProperty = vtkSmartPointer<vtkVolumeProperty>::New();
    volumeProperty->SetColor(colorTransferFunction);
    volumeProperty->SetScalarOpacity(opactiyTransferFunction);
    volumeProperty->SetGradientOpacity(gradientTransferFunction);
    volumeProperty->ShadeOn();//阴影
                              //volumeProperty->SetInterpolationTypeToLinear();//直线与样条插值之间逐发函数
    volumeProperty->SetAmbient(0.2);//环境光系数
    volumeProperty->SetDiffuse(0.9);//漫反射
    volumeProperty->SetSpecular(0.2);//高光系数
    volumeProperty->SetSpecularPower(10);//高光强度

    //计算光照效应
    vtkSmartPointer<vtkVolumeRayCastCompositeFunction>compositeRaycastFunction = vtkSmartPointer<vtkVolumeRayCastCompositeFunction>::New();
    vtkSmartPointer<vtkVolumeRayCastMapper>volumeMapper = vtkSmartPointer<vtkVolumeRayCastMapper>::New();
    volumeMapper->SetVolumeRayCastFunction(compositeRaycastFunction);
    volumeMapper->SetInputConnection(convCastFilter->GetOutputPort());
    
    //设置体属性
    vtkSmartPointer<vtkVolume>volume = vtkSmartPointer<vtkVolume>::New();
    volume->SetMapper(volumeMapper);
    volume->SetProperty(volumeProperty);

    vtkSmartPointer<vtkRenderer>ren1 = vtkSmartPointer<vtkRenderer>::New();
    ren1->AddVolume(volume);
    ren1->SetBackground(0, 0, 0);

    vtkSmartPointer<vtkRenderWindow>renWin = vtkSmartPointer<vtkRenderWindow>::New();
    renWin->AddRenderer(ren1);
    //renWin->AddRenderer(gradientMagnitudeRenderer);

    renWin->SetSize(800, 800);
    vtkSmartPointer<vtkRenderWindowInteractor>iren = vtkSmartPointer<vtkRenderWindowInteractor>::New();
    iren->SetRenderWindow(renWin);
    renWin->Render();
    iren->Start();
}


int main(int argc, char *argv[])
{
    double pos = 200.0;
    solve(pos);
}
View Code

 高斯滤波...感觉没太用对..或者参数没调好...感觉整个xiong都膨胀了一圈

//#include "PVSTGUI.h"
#include <QtWidgets/QApplication>

#include "vtkRenderer.h"
#include "vtkRenderWindow.h"
#include "vtkRenderWindowInteractor.h"
#include "vtkActor.h"
#include "vtkSmartPointer.h"
#include "vtkProperty.h"
#include "vtkCamera.h"
#include "vtkDICOMImageReader.h"
#include "vtkImageCast.h"
#include "vtkPiecewiseFunction.h"
#include "vtkColorTransferFunction.h"
#include "vtkVolumeProperty.h"
#include "vtkVolumeRayCastCompositeFunction.h"
#include "vtkVolumeRayCastMapper.h"
#include "vtkVolume.h"
#include <vtkImageGaussianSmooth.h> 
#include <vtkImageActor.h>
#include <vtkImageConvolve.h>
#include <vtkInteractorStyleImage.h>
#include <vtkAutoInit.h>
#include <cstdio>
#include <cstring>
#include <ctime>
#include <iostream>
#include <algorithm>
using namespace std;

void solve(double x)
{
    VTK_MODULE_INIT(vtkRenderingVolumeOpenGL2);
    vtkSmartPointer<vtkDICOMImageReader>dicomImagereader = vtkSmartPointer<vtkDICOMImageReader>::New();
    dicomImagereader->SetDirectoryName("C:\\Users\\lab\\Desktop\\1.3.6.1.4.1.14519.5.2.1.7695.2311.101194443955813969344566251700");
    dicomImagereader->SetDataByteOrderToLittleEndian();

    vtkSmartPointer<vtkImageCast>readerImageCast = vtkSmartPointer<vtkImageCast>::New();
    readerImageCast->SetInputConnection(dicomImagereader->GetOutputPort());
    readerImageCast->SetOutputScalarTypeToUnsignedShort();
    readerImageCast->Update();

    /*
    // ---- for test 均值滤波 ---------------------------------------------------------
    vtkSmartPointer<vtkImageConvolve> convolveFilter =
        vtkSmartPointer<vtkImageConvolve>::New();

    convolveFilter->SetInputConnection(readerImageCast->GetOutputPort());
    double kernel[25] = { 0.04,0.04,0.04,0.04,0.04,
        0.04,0.04,0.04,0.04,0.04,
        0.04,0.04,0.04,0.04,0.04,
        0.04,0.04,0.04,0.04,0.04,
        0.04,0.04,0.04,0.04,0.04 };

    convolveFilter->SetKernel5x5(kernel);
    convolveFilter->Update();
    vtkSmartPointer<vtkImageCast>convCastFilter =
        vtkSmartPointer<vtkImageCast>::New();
    convCastFilter->SetInputConnection(convolveFilter->GetOutputPort());
    convCastFilter->SetOutputScalarTypeToUnsignedChar();
    convCastFilter->Update();
    // ---- end test ----------------------------------------------------------------
    */

    // ---- for test 高斯滤波 --------------------------------------------------------
    
    vtkSmartPointer<vtkImageGaussianSmooth> gaussianSmoothFilter =
        vtkSmartPointer<vtkImageGaussianSmooth>::New();
    gaussianSmoothFilter->SetInputConnection(readerImageCast->GetOutputPort());
    gaussianSmoothFilter->SetDimensionality(3);
    gaussianSmoothFilter->SetRadiusFactor(0.8);
    gaussianSmoothFilter->SetStandardDeviation(1);
    gaussianSmoothFilter->Update();

    // ---- end test ----------------------------------------------------------------



    //不透明度传输函数
    vtkSmartPointer<vtkPiecewiseFunction>opactiyTransferFunction = vtkSmartPointer<vtkPiecewiseFunction>::New();
    /*
    opactiyTransferFunction->AddPoint(120, 0.0);
    opactiyTransferFunction->AddPoint(250, 1.0);
    opactiyTransferFunction->AddPoint(250, 1.0);
    opactiyTransferFunction->AddPoint(520, 1.0);
    opactiyTransferFunction->AddPoint(650, 0.0);
    */

    // ---- test begin --------
    opactiyTransferFunction->AddPoint(100, 0.0);
    opactiyTransferFunction->AddPoint(240, 1.0);
    opactiyTransferFunction->AddPoint(242, 0.0);
    opactiyTransferFunction->AddPoint(1495, 1.0);

    //opactiyTransferFunction->AddPoint(129, 1.0);
    //opactiyTransferFunction->AddPoint(240, 0.0);
    //opactiyTransferFunction->AddPoint(300, 1.0);
    //opactiyTransferFunction->AddPoint(300, 1.0);
    //opactiyTransferFunction->AddPoint(700, 1.0);
    //opactiyTransferFunction->AddPoint(900, 0.0);
    // ---- test end ----------


    //颜色传输函数
    vtkSmartPointer<vtkColorTransferFunction>colorTransferFunction = vtkSmartPointer<vtkColorTransferFunction>::New();
    //colorTransferFunction->AddRGBPoint(120, 255 / 255.0, 98 / 255.0, 98 / 255.0);
    //colorTransferFunction->AddRGBPoint(250, 255 / 255.0, 255 / 255.0, 180 / 255.0);
    //colorTransferFunction->AddRGBPoint(520, 1.0, 1.0, 1.0);
    //colorTransferFunction->AddRGBPoint(650, 1.0, 1.0, 1.0);

    colorTransferFunction->AddRGBPoint(100, 207 / 255.0, 147 / 255.0, 89 / 255.0);//黄色
    colorTransferFunction->AddRGBPoint(105, 255 / 255.0, 255 / 255.0, 255 / 255.0);//白色
    colorTransferFunction->AddRGBPoint(129, 255 / 255.0, 98 / 255.0, 98 / 255.0);//红色
    colorTransferFunction->AddRGBPoint(240, 205 / 255.0, 133 / 255.0, 63 / 255.0); //深黄色
    colorTransferFunction->AddRGBPoint(242, 255 / 255.0, 255 / 255.0, 255 / 255.0); //白色
    colorTransferFunction->AddRGBPoint(1495, 207 / 255.0, 147 / 255.0, 89 / 255.0); //黄色

    // ---- test begin ------
    //colorTransferFunction->AddRGBPoint(120, 255 / 255.0, 98 / 255.0, 98 / 255.0);
    //colorTransferFunction->AddRGBPoint(250, 255 / 255.0, 255 / 255.0, 180 / 255.0);
    //colorTransferFunction->AddRGBPoint(250, 1.0, 1.0, 1.0);
    //colorTransferFunction->AddRGBPoint(1500, 1.0, 0, 0);
    // ---- test end --------

    //梯度不透明度函数
    vtkSmartPointer<vtkPiecewiseFunction>gradientTransferFunction = vtkSmartPointer<vtkPiecewiseFunction>::New();
    gradientTransferFunction->AddPoint(120, 2.0);
    gradientTransferFunction->AddPoint(250, 2.0);
    gradientTransferFunction->AddPoint(520, 0.1);
    gradientTransferFunction->AddPoint(650, 0.1);

    vtkSmartPointer<vtkVolumeProperty>volumeProperty = vtkSmartPointer<vtkVolumeProperty>::New();
    volumeProperty->SetColor(colorTransferFunction);
    volumeProperty->SetScalarOpacity(opactiyTransferFunction);
    volumeProperty->SetGradientOpacity(gradientTransferFunction);
    volumeProperty->ShadeOn();//阴影
                              //volumeProperty->SetInterpolationTypeToLinear();//直线与样条插值之间逐发函数
    volumeProperty->SetAmbient(0.2);//环境光系数
    volumeProperty->SetDiffuse(0.9);//漫反射
    volumeProperty->SetSpecular(0.2);//高光系数
    volumeProperty->SetSpecularPower(10);//高光强度

                                         //计算光照效应
    vtkSmartPointer<vtkVolumeRayCastCompositeFunction>compositeRaycastFunction = vtkSmartPointer<vtkVolumeRayCastCompositeFunction>::New();
    vtkSmartPointer<vtkVolumeRayCastMapper>volumeMapper = vtkSmartPointer<vtkVolumeRayCastMapper>::New();
    volumeMapper->SetVolumeRayCastFunction(compositeRaycastFunction);
    volumeMapper->SetInputConnection(gaussianSmoothFilter->GetOutputPort());

    //设置体属性
    vtkSmartPointer<vtkVolume>volume = vtkSmartPointer<vtkVolume>::New();
    volume->SetMapper(volumeMapper);
    volume->SetProperty(volumeProperty);

    vtkSmartPointer<vtkRenderer>ren1 = vtkSmartPointer<vtkRenderer>::New();
    ren1->AddVolume(volume);
    ren1->SetBackground(0, 0, 0);

    vtkSmartPointer<vtkRenderWindow>renWin = vtkSmartPointer<vtkRenderWindow>::New();
    renWin->AddRenderer(ren1);
    //renWin->AddRenderer(gradientMagnitudeRenderer);

    renWin->SetSize(800, 800);
    vtkSmartPointer<vtkRenderWindowInteractor>iren = vtkSmartPointer<vtkRenderWindowInteractor>::New();
    iren->SetRenderWindow(renWin);
    renWin->Render();
    iren->Start();
}

int main(int argc, char *argv[])
{
    double pos = 200.0;
    solve(pos);
}
View Code

 

8.19 >_<

果然老看CT...各种骨骼...头骨....器官.....做做做做噩梦了阿............

-------- 昏割线 -----

早起看uoj裙..有人问a垂直于b是什么...原来是互质

比如每一维度 是 这样 2 3 5 7 11 13

对于每个数的组成就是,在该维下的指数的大小

所以 2 只由 2组成 ,可以看成[1,0,0,0,......]

3 是 [0,1,0,0,0,.......]

4是 [2,0,0,0,0.........]

所以两个数互质,两个向量就是互相垂直的,取min 就是 gcd,取max 就是 lcm

 

Qt 滑动条

愧对cv上的求职意向 C++ 研发工程师 qaqqqqaq  头文件.cpp 和 源文件.h 的写法

 

8.20 >_<

VTK 图像像素位置提取

VTK 交互类

 

^_^

 

 8.21 >_<

还是不懂重定义鼠标事件

热得病倒在床才发现高温持续一周多了233333333

 

8.22 >_<

Qt事件

鼠标事件的一个demo

 

8.23 >_<

天鸽要来了 2333334

VTK入门

 VS 项目右键 属性 C/C++ 里可以设置 多处理器编译

 备份

//#include "PVSTGUI.h"
#include <QtWidgets/QApplication>
#include "vtkRenderer.h"
#include "vtkRenderWindow.h"
#include "vtkRenderWindowInteractor.h"
#include "vtkActor.h"
#include "vtkSmartPointer.h"
#include "vtkProperty.h"
#include "vtkCamera.h"
#include "vtkDICOMImageReader.h"
#include "vtkImageCast.h"
#include "vtkPiecewiseFunction.h"
#include "vtkColorTransferFunction.h"
#include "vtkVolumeProperty.h"
#include "vtkVolumeRayCastCompositeFunction.h"
#include "vtkVolumeRayCastMapper.h"
#include "vtkVolume.h"
#include <vtkImageGaussianSmooth.h> 
#include <vtkImageActor.h>
#include <vtkImageConvolve.h>
#include <vtkInteractorStyleImage.h>
#include <vtkAutoInit.h>
#include <cstdio>
#include <cstring>
#include <ctime>
#include <iostream>
#include <algorithm>
using namespace std;

void solve(double x)
{
    VTK_MODULE_INIT(vtkRenderingVolumeOpenGL2);
    vtkSmartPointer<vtkDICOMImageReader>dicomImagereader = vtkSmartPointer<vtkDICOMImageReader>::New();
    dicomImagereader->SetDirectoryName("C:\\Users\\lab\\Desktop\\1.3.6.1.4.1.14519.5.2.1.7695.2311.101194443955813969344566251700");
    dicomImagereader->SetDataByteOrderToLittleEndian();

    vtkSmartPointer<vtkImageCast>readerImageCast = vtkSmartPointer<vtkImageCast>::New();
    readerImageCast->SetInputConnection(dicomImagereader->GetOutputPort());
    readerImageCast->SetOutputScalarTypeToUnsignedShort();
    readerImageCast->Update();


    // ---- for test 高斯滤波 --------------------------------------------------------
    vtkSmartPointer<vtkImageGaussianSmooth> gaussianSmoothFilter =
        vtkSmartPointer<vtkImageGaussianSmooth>::New();
    gaussianSmoothFilter->SetInputConnection(readerImageCast->GetOutputPort());
    gaussianSmoothFilter->SetDimensionality(3);
    gaussianSmoothFilter->SetRadiusFactor(0.8);
    gaussianSmoothFilter->SetStandardDeviation(1);
    gaussianSmoothFilter->Update();
    // ---- end test ----------------------------------------------------------------

    //不透明度传输函数
    vtkSmartPointer<vtkPiecewiseFunction>opactiyTransferFunction = vtkSmartPointer<vtkPiecewiseFunction>::New();
    /*
    opactiyTransferFunction->AddPoint(120, 0.0);
    opactiyTransferFunction->AddPoint(250, 1.0);
    opactiyTransferFunction->AddPoint(250, 1.0);
    opactiyTransferFunction->AddPoint(520, 1.0);
    opactiyTransferFunction->AddPoint(650, 0.0);
    */

    // ---- test begin --------
    opactiyTransferFunction->AddPoint(100, 0.0);
    opactiyTransferFunction->AddPoint(240, 1.0);
    opactiyTransferFunction->AddPoint(242, 0.0);
    opactiyTransferFunction->AddPoint(1495, 1.0);

    //opactiyTransferFunction->AddPoint(129, 1.0);
    //opactiyTransferFunction->AddPoint(240, 0.0);
    //opactiyTransferFunction->AddPoint(300, 1.0);
    //opactiyTransferFunction->AddPoint(300, 1.0);
    //opactiyTransferFunction->AddPoint(700, 1.0);
    //opactiyTransferFunction->AddPoint(900, 0.0);
    // ---- test end ----------

    //颜色传输函数
    vtkSmartPointer<vtkColorTransferFunction>colorTransferFunction = vtkSmartPointer<vtkColorTransferFunction>::New();
    //colorTransferFunction->AddRGBPoint(120, 255 / 255.0, 98 / 255.0, 98 / 255.0);
    //colorTransferFunction->AddRGBPoint(250, 255 / 255.0, 255 / 255.0, 180 / 255.0);
    //colorTransferFunction->AddRGBPoint(520, 1.0, 1.0, 1.0);
    //colorTransferFunction->AddRGBPoint(650, 1.0, 1.0, 1.0);

    colorTransferFunction->AddRGBPoint(100, 207 / 255.0, 147 / 255.0, 89 / 255.0);//黄色
    colorTransferFunction->AddRGBPoint(105, 255 / 255.0, 255 / 255.0, 255 / 255.0);//白色
    colorTransferFunction->AddRGBPoint(129, 255 / 255.0, 98 / 255.0, 98 / 255.0);//红色
    colorTransferFunction->AddRGBPoint(240, 205 / 255.0, 133 / 255.0, 63 / 255.0); //深黄色
    colorTransferFunction->AddRGBPoint(242, 255 / 255.0, 255 / 255.0, 255 / 255.0); //白色
    colorTransferFunction->AddRGBPoint(1495, 207 / 255.0, 147 / 255.0, 89 / 255.0); //黄色

    //梯度不透明度函数
    vtkSmartPointer<vtkPiecewiseFunction>gradientTransferFunction = vtkSmartPointer<vtkPiecewiseFunction>::New();
    gradientTransferFunction->AddPoint(120, 2.0);
    gradientTransferFunction->AddPoint(250, 2.0);
    gradientTransferFunction->AddPoint(520, 0.1);
    gradientTransferFunction->AddPoint(650, 0.1);

    vtkSmartPointer<vtkVolumeProperty>volumeProperty = vtkSmartPointer<vtkVolumeProperty>::New();
    volumeProperty->SetColor(colorTransferFunction);
    volumeProperty->SetScalarOpacity(opactiyTransferFunction);
    volumeProperty->SetGradientOpacity(gradientTransferFunction);
    volumeProperty->ShadeOn();//阴影
                              volumeProperty->SetInterpolationTypeToLinear();//直线与样条插值之间逐发函数
    volumeProperty->SetAmbient(0.2);//环境光系数
    volumeProperty->SetDiffuse(0.9);//漫反射
    volumeProperty->SetSpecular(0.2);//高光系数
    volumeProperty->SetSpecularPower(10);//高光强度

                                         //计算光照效应
    vtkSmartPointer<vtkVolumeRayCastCompositeFunction>compositeRaycastFunction = vtkSmartPointer<vtkVolumeRayCastCompositeFunction>::New();
    vtkSmartPointer<vtkVolumeRayCastMapper>volumeMapper = vtkSmartPointer<vtkVolumeRayCastMapper>::New();
    volumeMapper->SetVolumeRayCastFunction(compositeRaycastFunction);
    volumeMapper->SetInputConnection(gaussianSmoothFilter->GetOutputPort());

    //设置体属性
    vtkSmartPointer<vtkVolume>volume = vtkSmartPointer<vtkVolume>::New();
    volume->SetMapper(volumeMapper);
    volume->SetProperty(volumeProperty);

    vtkSmartPointer<vtkRenderer>ren1 = vtkSmartPointer<vtkRenderer>::New();
    ren1->AddVolume(volume);
    ren1->SetBackground(0, 0, 0);

    vtkSmartPointer<vtkRenderWindow>renWin = vtkSmartPointer<vtkRenderWindow>::New();
    renWin->AddRenderer(ren1);
    //renWin->AddRenderer(gradientMagnitudeRenderer);

    renWin->SetSize(800, 800);
    vtkSmartPointer<vtkRenderWindowInteractor>iren = vtkSmartPointer<vtkRenderWindowInteractor>::New();
    iren->SetRenderWindow(renWin);
    renWin->Render();
    iren->Start();
}

int main(int argc, char *argv[])
{
    double pos = 200.0;
    solve(pos);
}
View Code

 

8.24  >_<

 

台风过境w

 

在项目里面有 xxx.cpp ,但是却报错 找不到 xxxx.cpp 的时候... 遇到的情况是这两种

xxxx.cpp 是复制过去的,虽然在vs里面看在项目里面,但是文件位置不在这个项目

没有加头文件#include <QtWidgets/QApplication>进行编译,所以会找不到一个叫 moc_xxxx.cpp的东西

 

8.25 >_<

 QTableWidget

 

8.26 >_<

cf428div2 (过了快两周断断续续补完qaq,太菜啦qaq)

A.Arya and Bran

赛时cnt清0顺序错....被hack....爆零qaqqaqaqq

#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std;
typedef long long LL;
const int maxn = 1e5+5;

int n,k,a[maxn];

int main() 
{
    scanf("%d %d",&n,&k);
    for (int i = 1;i <= n;i++) scanf("%d",&a[i]);
    int ans = -1,cnt = 0;
    for (int i = 1;i <= n;i++)
    {
        if (a[i] + cnt <= 8)
        {
            k -= (a[i] + cnt);
            cnt = 0;
        }
        else
        {
            k -= 8;
            cnt += (a[i] - 8);
        }
        if (k <= 0) {ans = i;break;}
    }
    printf("%d\n",ans);
    return 0;
}
View Code

B.Game of the Rows

看过的人好少...都不敢写..后来想清楚..和之前gg笔试一题枚举xxx 的 有 多少个 xxx的有多少个 xxxx的有多少个 想法很类似 1A 喔 !

#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std;
typedef long long LL;
const int maxn = 1e5+5;

int k,n,a[maxn];

int main() 
{
    scanf("%d %d",&n,&k);
    for (int i = 1;i <= k;i++) scanf("%d",&a[i]);
    sort(a+1,a+k+1);
    int flag = 0;
    for (int i = 0;i <= k;i++)
    {
        int one = i,two = (2 * n + i),four = n - i;
        int cnt = 0;

        //printf("one = %d two = %d four = %d \n",one,two,four);

        for (int j = k;j >= 1;j--)
        {
            int v = a[j];
            int x = v / 4;
            if (four >= x)
            {
                v -= 4 * x;four -= x;
            }
            else
            {
                v -= four * 4;four = 0;
            }

        //    printf("j = %d v1 = %d ",j,v);

            if (v <= 0) {cnt++;continue;}
            x = v / 2;
            if (two >= x)
            {
                v -= 2 * x;
                two -= x;
            }
            else
            {
                v -= two * 2;two = 0;
            }
        //    printf("j = %d v2 = %d ",j,v);
            if (v <= 0) {cnt++;continue;}
            if (one >= v)
            {
                one -= v;
                v = 0;
            }
            else
            {
                v -= one;one = 0;
            }

        //    printf("j = %d v3 = %d ",j,v);

            if (two >= v)
            {
                two -= v;v = 0;
            }

        //    printf("j = %d v4 = %d \n",j,v);

            if (v <= 0) {cnt++;continue;}
        }
        //printf("i = %d cnt = %d\n",i,cnt);
        if (cnt == k) {flag = 1;break;}
    }

    if (flag == 1) puts("YES");
    else puts("NO");

    return 0;
}
View Code

C.Journey

不会期望..自己写的时候 一直 按照算贡献那样来求期望...但是 不对的....具体为什么不对还是说不上来....看了题解还是对期望 很茫然...应该再做一些期望的题叭

ans[i] 表示 以 i 为根 然后.... 的期望,所以 是 ans[i] = (ans[v1] + ans[v2] + ... ans[vk] ) / k + 1

#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
const int maxn = 1e5+5;
int n;
double ans[maxn];
vector<int> g[maxn];

void dfs(int u,int fa)
{
    int sz = 0;
    for (int i = 0;i < g[u].size();i++)
    {
        int v = g[u][i];
        if (v == fa) continue;
        sz++;
        dfs(v,u);
        ans[u] = ans[u] + ans[v];
    }
    if (sz) ans[u] = ans[u] / sz + 1;
}

int main()
{
    scanf("%d",&n);
    int u,v;
    for (int i = 1;i < n;i++)
    {
        scanf("%d %d",&u,&v);
        g[u].push_back(v);
        g[v].push_back(u);
    }
    memset(ans,0,sizeof(ans));

    dfs(1,-1);

  //  for (int i = 1;i <= n;i++) printf("ans[%d] = %f\n",i,ans[i]);

    printf("%.15f\n",ans[1]);

    return 0;
}
View Code

D.Winter is here

找出 所有 序列gcd 不是 1 的 gcd * k 的和,k 是这个序列的长度

cnt[i] 表示 能整除 i 的数的个数,能够构成 的序列 个数 为 C(cnt[i],k) (k 的取值 从 1 到 cnt[i]) 

所以,要求 的是 sigma C(cnt[i],k) * k * gcd ,然后这样会重,要 减去 2*i ,3*i ,4 * i 的情况

再然后就是这个求和式子的化简...看懂了好感动qaqaq...

总之就是...枚举gcd 再容斥... 数学..渣

#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std;
typedef long long LL;
const int maxn = 1e6+5;
typedef long long LL;
const long long mod = 1e9 + 7;

int n,a[maxn],cnt[maxn],cunt[maxn];
LL p[maxn],f[maxn];

int main() 
{
    scanf("%d",&n);
    memset(cunt,0,sizeof(cunt));
    p[0] = 1LL;
    for (int i = 1;i <= n;i++) 
    {
        scanf("%d",&a[i]);cunt[a[i]]++;p[i] = p[i-1] * 2LL % mod;
    }
    memset(cnt,0,sizeof(cnt));
    for (int i = 2;i < maxn;i++)
    {
        cnt[i] += cunt[i];
        for (int j = i << 1;j < maxn;j += i)
        {
            cnt[i] += cunt[j];
        }
    }

    //for (int i = 2;i <= 10;i++) printf("cnt[%d] = %d\n",i,cnt[i]);

    LL ans = 0LL;
    memset(f,0,sizeof(f));
    for (int i = maxn - 1;i >= 2;i--)
    {
        if (cnt[i] == 0) continue;
        f[i] = cnt[i] * p[cnt[i] - 1] % mod;
        for (int j = i << 1;j < maxn;j += i)
        {
            f[i] = (f[i] - f[j] + mod) % mod;
        }
        ans = (ans + (f[i] * i % mod)) % mod;
    }
    printf("%I64d\n",ans);
    return 0;
}
View Code

 

E.Mother of Dragons

把k的值平均分配到求出的最大团的点上...证明还没有看..

#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std;

int n,m,k,id;
int e[105][105]; //表示最大团关系,e[i][j] == 1 表示 i 与 j 之间没有排斥关系
int f[105][105]; //把存边方式从邻接矩阵边转化为邻接链表,加快速度
int mx[105]; //mx[i]表示最大团中编号最小的点的编号>=i时的最大团答案
int ans; //全局变量,最后得到的ans就是全局最大团

int mcp(int num,int p)
{
    if (!p) //没有边直接更新答案
    {
        if (num > ans) {ans = num;return 1;}
        else return 0;
    }
    for (int i = 0;i < p;++i)
    {
        // 如果把接下来的所有点都加入最大团中,还无法更新答案,返回no
        if (num + p-i <= ans) return 0;
        int u = f[num][i];
        // 如果把目前编号最小的节点所能延展的所有点都加入最大团中,还无法更新答案,返回no
        if (mx[u] + num <= ans) return 0;
        int k = 0;
        for (int j = i+1;j < p;j++) if (e[u][f[num][j]]) f[num+1][k++] = f[num][j];
        if (mcp(num+1,k)) return 1;
    }
    return 0;
}

void MCP()
{
    memset(f,0,sizeof(f));
    memset(mx,0,sizeof(mx));
    ans = 0;
    for (int i = id;i >= 1;--i)
    {
        int k = 0;
        for (int j = i+1;j <= id;j++) if (e[i][j]) f[1][k++] = j;
        mcp(1,k);
        mx[i] = ans;
    }

   // for (int i = 1;i <= id;i++) printf("mx[%d] = %d\n",i,mx[i]);

   double res = 1.0 * (ans - 1) * k * k / (2.0 * ans);
   printf("%.12f\n",res);

}

int main()
{
    scanf("%d %d",&n,&k);
    memset(e,0,sizeof(e));
    for (int i = 1;i <= n;i++)
    {
        for (int j = 1;j <= n;j++) scanf("%d",&e[i][j]);

    }
    id = n;
    MCP();

    return 0;
}
View Code

 

转载于:https://www.cnblogs.com/wuyuewoniu/p/7266591.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值