39 lines
769 B
Go
39 lines
769 B
Go
package cmd
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/spf13/cobra"
|
|
"starwiz.cn/sjy01/preprocessing/extract"
|
|
)
|
|
|
|
var (
|
|
dataId string
|
|
)
|
|
|
|
var extractCmd = &cobra.Command{
|
|
Use: "extract",
|
|
Short: "Extract data from raw data files",
|
|
Long: `Extract data from raw data files`,
|
|
Run: func(cmd *cobra.Command, args []string) {
|
|
params := extract.Params{
|
|
InputData: fmt.Sprintf("demo/%s.dat", dataId),
|
|
OutputPath: "demo/output",
|
|
TempPath: "demo/temp",
|
|
DataId: dataId,
|
|
}
|
|
p := extract.NewExtractor(¶ms)
|
|
p.ExtractAosData()
|
|
dats, _ := p.ExtractOriginalImageData()
|
|
for _, d := range dats {
|
|
p.SeprateAuxAndImgData(d)
|
|
}
|
|
},
|
|
}
|
|
|
|
func init() {
|
|
rootCmd.AddCommand(extractCmd)
|
|
|
|
extractCmd.Flags().StringVarP(&dataId, "data id", "d", "051513", "051513")
|
|
}
|